<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<link rel=File-List href="./tutorial_files/filelist.xml">
<link rel=Edit-Time-Data href="./tutorial_files/editdata.mso">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>J/VERSANT Interface 2.1: Object Sharing Tutorial </title>
<!--[if gte mso 9]><xml>
 <o:DocumentProperties>
  <o:Author>release</o:Author>
  <o:Template>Normal</o:Template>
  <o:LastAuthor>release</o:LastAuthor>
  <o:Revision>20</o:Revision>
  <o:TotalTime>18</o:TotalTime>
  <o:Created>2007-01-02T12:26:00Z</o:Created>
  <o:LastSaved>2007-01-09T11:46:00Z</o:LastSaved>
  <o:Pages>30</o:Pages>
  <o:Words>19199</o:Words>
  <o:Characters>109435</o:Characters>
  <o:Company>Versant GmbH</o:Company>
  <o:Lines>911</o:Lines>
  <o:Paragraphs>218</o:Paragraphs>
  <o:CharactersWithSpaces>134393</o:CharactersWithSpaces>
  <o:Version>9.3821</o:Version>
 </o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
  <w:GrammarState>Clean</w:GrammarState>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
 </w:WordDocument>
</xml><![endif]-->
<style>
<!--
span.GRAME
	{mso-gram-e:yes;}
 /* Font Definitions */
@font-face
	{font-family:Times;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:Helvetica;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:Courier;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:Geneva;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:"Tms Rmn";
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:Helv;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:"MS Serif";
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:"MS Sans Serif";
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:"New York";
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:System;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;
	mso-font-charset:2;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
	{font-family:Mincho;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-alt:\660E\671D;
	mso-font-charset:128;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 134676480 16 0 131072 0;}
@font-face
	{font-family:Batang;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-alt:\BC14\D0D5;
	mso-font-charset:129;
	mso-generic-font-family:auto;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 151388160 16 0 524288 0;}
@font-face
	{font-family:SimSun;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-alt:\5B8B\4F53;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:1 135135232 16 0 262144 0;}
@font-face
	{font-family:PMingLiU;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-alt:\65B0\7D30\660E\9AD4;
	mso-font-charset:136;
	mso-generic-font-family:auto;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:1 134742016 16 0 1048576 0;}
@font-face
	{font-family:Gothic;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-alt:\FF7B\FF9E\FF7C\FF6F\FF78;
	mso-font-charset:128;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 134676480 16 0 131072 0;}
@font-face
	{font-family:Dotum;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-alt:\B3CB\C6C0;
	mso-font-charset:129;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 151388160 16 0 524288 0;}
@font-face
	{font-family:SimHei;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-alt:\9ED1\4F53;
	mso-font-charset:134;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 135135232 16 0 262144 0;}
@font-face
	{font-family:MingLiU;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-alt:\7D30\660E\9AD4;
	mso-font-charset:136;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 134742016 16 0 1048576 0;}
@font-face
	{font-family:"MS Mincho";
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-alt:"\FF2D\FF33 \660E\671D";
	mso-font-charset:128;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 134676480 16 0 131072 0;}
@font-face
	{font-family:Gulim;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-alt:\AD74\B9BC;
	mso-font-charset:129;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 151388160 16 0 524288 0;}
@font-face
	{font-family:"MS Gothic";
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-alt:"\FF2D\FF33 \30B4\30B7\30C3\30AF";
	mso-font-charset:128;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 134676480 16 0 131072 0;}
@font-face
	{font-family:Century;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:553679495 -2147483648 8 0 66047 0;}
@font-face
	{font-family:"Angsana New";
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:222;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:16777217 0 0 0 65536 0;}
@font-face
	{font-family:"Cordia New";
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:222;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:16777217 0 0 0 65536 0;}
@font-face
	{font-family:Mangal;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:32768 0 0 0 0 0;}
@font-face
	{font-family:Latha;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:1048576 0 0 0 0 0;}
@font-face
	{font-family:Sylfaen;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:16778883 0 512 0 13 0;}
@font-face
	{font-family:Vrinda;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Raavi;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Shruti;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Sendnya;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Gautami;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Tunga;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:"Estrangelo Edessa";
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Kartika;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:"Arial Unicode MS";
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:Terminal;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:255;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:Fixedsys;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:"Small Fonts";
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:Marlett;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:2;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
	{font-family:"Lucida Console";
	panose-1:2 11 6 9 4 5 4 2 2 4;
	mso-font-charset:0;
	mso-generic-font-family:modern;
	mso-font-pitch:fixed;
	mso-font-signature:-2147482993 6144 0 0 31 0;}
@font-face
	{font-family:"Lucida Sans Unicode";
	panose-1:2 11 6 2 3 5 4 2 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-2147476737 14699 0 0 63 0;}
@font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:536871559 0 0 0 415 0;}
@font-face
	{font-family:"Arial Black";
	panose-1:2 11 10 4 2 1 2 2 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:647 0 0 0 159 0;}
@font-face
	{font-family:"Comic Sans MS";
	panose-1:3 15 7 2 3 3 2 2 2 4;
	mso-font-charset:0;
	mso-generic-font-family:script;
	mso-font-pitch:variable;
	mso-font-signature:647 0 0 0 159 0;}
@font-face
	{font-family:Impact;
	panose-1:2 11 8 6 3 9 2 5 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:647 0 0 0 159 0;}
@font-face
	{font-family:Georgia;
	panose-1:2 4 5 2 5 4 5 2 3 3;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:647 0 0 0 159 0;}
@font-face
	{font-family:"Palatino Linotype";
	panose-1:2 4 5 2 5 5 5 3 3 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:-536870009 1073741843 0 0 415 0;}
@font-face
	{font-family:"Trebuchet MS";
	panose-1:2 11 6 3 2 2 2 2 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:7 0 0 0 19 0;}
@font-face
	{font-family:Webdings;
	panose-1:5 3 1 2 1 5 9 6 7 3;
	mso-font-charset:2;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
	{font-family:"Microsoft Sans Serif";
	panose-1:2 11 6 4 2 2 2 2 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:553679495 -2147483648 8 0 66047 0;}
@font-face
	{font-family:"Arial Narrow";
	panose-1:2 11 5 6 2 2 2 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:647 0 0 0 159 0;}
@font-face
	{font-family:"Book Antiqua";
	panose-1:2 4 6 2 5 3 5 3 3 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:647 0 0 0 159 0;}
@font-face
	{font-family:"Bookman Old Style";
	panose-1:2 5 6 4 5 5 5 2 2 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:647 0 0 0 159 0;}
@font-face
	{font-family:"Century Gothic";
	panose-1:2 11 5 2 2 2 2 2 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:647 0 0 0 159 0;}
@font-face
	{font-family:Garamond;
	panose-1:2 2 4 4 3 3 1 1 8 3;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:647 0 0 0 159 0;}
@font-face
	{font-family:Haettenschweiler;
	panose-1:2 11 7 6 4 9 2 6 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:647 0 0 0 159 0;}
@font-face
	{font-family:"Monotype Corsiva";
	panose-1:3 1 1 1 1 2 1 1 1 1;
	mso-font-charset:0;
	mso-generic-font-family:script;
	mso-font-pitch:variable;
	mso-font-signature:647 0 0 0 159 0;}
@font-face
	{font-family:"MS Outlook";
	panose-1:5 0 0 0 0 0 0 0 0 0;
	mso-font-charset:2;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
	{font-family:"Wingdings 2";
	panose-1:5 2 1 2 1 5 7 7 7 7;
	mso-font-charset:2;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
	{font-family:"Wingdings 3";
	panose-1:5 4 1 2 1 8 7 7 7 7;
	mso-font-charset:2;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
 /* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
h1
	{margin-right:0in;
	mso-margin-top-alt:auto;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	mso-outline-level:1;
	font-size:24.0pt;
	font-family:"Times New Roman";
	mso-font-kerning:18.0pt;
	font-weight:bold;}
h2
	{margin-right:0in;
	mso-margin-top-alt:auto;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	mso-outline-level:2;
	font-size:18.0pt;
	font-family:"Times New Roman";
	font-weight:bold;}
h3
	{margin-right:0in;
	mso-margin-top-alt:auto;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	mso-outline-level:3;
	font-size:13.5pt;
	font-family:"Times New Roman";
	font-weight:bold;}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
p
	{margin-right:0in;
	mso-margin-top-alt:auto;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
pre
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
	font-size:10.0pt;
	font-family:"Courier New";
	mso-fareast-font-family:"Times New Roman";}
tt
	{mso-ascii-font-family:"Courier New";
	mso-fareast-font-family:"Times New Roman";
	mso-hansi-font-family:"Courier New";
	mso-bidi-font-family:"Courier New";}
span.msoIns
	{mso-style-type:export-only;
	mso-style-name:"";
	text-decoration:underline;
	text-underline:single;
	color:teal;}
span.msoDel
	{mso-style-type:export-only;
	mso-style-name:"";
	text-decoration:line-through;
	color:red;}
span.msoChangeProp
	{mso-style-type:export-only;
	mso-style-name:"";
	color:black;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:70.85pt 70.85pt 56.7pt 70.85pt;
	mso-header-margin:35.4pt;
	mso-footer-margin:35.4pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
@list l0
	{mso-list-id:101607620;
	mso-list-template-ids:-328807452;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l0:level2
	{mso-level-tab-stop:1.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level3
	{mso-level-tab-stop:1.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level4
	{mso-level-tab-stop:2.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level5
	{mso-level-tab-stop:2.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level6
	{mso-level-tab-stop:3.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level7
	{mso-level-tab-stop:3.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level8
	{mso-level-tab-stop:4.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level9
	{mso-level-tab-stop:4.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l1
	{mso-list-id:796336449;
	mso-list-template-ids:-985520834;}
@list l1:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l1:level2
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:1.0in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:"Courier New";
	mso-bidi-font-family:"Times New Roman";}
@list l1:level3
	{mso-level-tab-stop:1.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l1:level4
	{mso-level-tab-stop:2.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l1:level5
	{mso-level-tab-stop:2.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l1:level6
	{mso-level-tab-stop:3.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l1:level7
	{mso-level-tab-stop:3.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l1:level8
	{mso-level-tab-stop:4.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l1:level9
	{mso-level-tab-stop:4.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l2
	{mso-list-id:1696685474;
	mso-list-template-ids:-1101395550;}
@list l2:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l2:level2
	{mso-level-tab-stop:1.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l2:level3
	{mso-level-tab-stop:1.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l2:level4
	{mso-level-tab-stop:2.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l2:level5
	{mso-level-tab-stop:2.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l2:level6
	{mso-level-tab-stop:3.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l2:level7
	{mso-level-tab-stop:3.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l2:level8
	{mso-level-tab-stop:4.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l2:level9
	{mso-level-tab-stop:4.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l3
	{mso-list-id:1968270712;
	mso-list-template-ids:-397795808;}
@list l3:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l3:level2
	{mso-level-tab-stop:1.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l3:level3
	{mso-level-tab-stop:1.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l3:level4
	{mso-level-tab-stop:2.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l3:level5
	{mso-level-tab-stop:2.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l3:level6
	{mso-level-tab-stop:3.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l3:level7
	{mso-level-tab-stop:3.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l3:level8
	{mso-level-tab-stop:4.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l3:level9
	{mso-level-tab-stop:4.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
-->
</style>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"/><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">  </w:LatentStyles>
</xml><![endif]--><!-- saved from url=(0022)http://internet.e-mail -->
</head>

<body lang=EN-US link=blue vlink=blue style='tab-interval:35.4pt'>

<div class=Section1>

<h1><span lang=EN-GB style='mso-ansi-language:EN-GB'>J/VERSANT Interface 7.0.1:
Object Sharing Tutorial<o:p></o:p></span></h1>

<p class=MsoNormal><a name=top></a><b><span lang=EN-GB style='mso-ansi-language:
EN-GB'>Contents:</span></b><span lang=EN-GB style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<p><a name=c1></a><a href="#s1"></a><a href="#s1"></a><a href="#s1"></a><a
href="#s1"></a><a href="#s1"></a><a href="#s1"></a><a href="#s1"></a><a
href="#s1"></a><a href="#s1"></a><a href="#s1"></a><a href="#s1"></a><a
href="#s1"></a><a href="#s1"></a><a href="#s1"></a><a href="#s1"></a><a
href="#s1"></a><a href="#s1"></a><a href="#s1"></a><a href="#s1"></a><a
href="#s1"><span style='mso-bookmark:c1'><span lang=EN-GB style='mso-ansi-language:
EN-GB'>1. Introduction</span></span><span style='mso-bookmark:c1'></span></a><span
style='mso-bookmark:c1'></span><span style='mso-ansi-language:EN-GB'> <span
lang=EN-GB><o:p></o:p></span></span></p>

<p><a name=c2></a><a href="#s2"></a><a href="#s2"></a><a href="#s2"></a><a
href="#s2"></a><a href="#s2"></a><a href="#s2"></a><a href="#s2"></a><a
href="#s2"></a><a href="#s2"></a><a href="#s2"></a><a href="#s2"></a><a
href="#s2"></a><a href="#s2"></a><a href="#s2"></a><a href="#s2"></a><a
href="#s2"></a><a href="#s2"></a><a href="#s2"></a><a href="#s2"></a><a
href="#s2"><span style='mso-bookmark:c2'><span lang=EN-GB style='mso-ansi-language:
EN-GB'>2. Basic Concepts</span></span><span style='mso-bookmark:c2'></span></a><span
style='mso-bookmark:c2'></span><span lang=EN-GB style='mso-ansi-language:EN-GB'>
<br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s2.1"></a><a
href="#s2.1"></a><a href="#s2.1"></a><a href="#s2.1"></a><a href="#s2.1"></a><a
href="#s2.1"></a><a href="#s2.1"></a><a href="#s2.1"></a><a href="#s2.1"></a><a
href="#s2.1"></a><a href="#s2.1"></a><a href="#s2.1"></a><a href="#s2.1"></a><a
href="#s2.1"></a><a href="#s2.1"></a><a href="#s2.1"></a><a href="#s2.1"></a><a
href="#s2.1"></a><a href="#s2.1"></a><a href="#s2.1"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>2.1. Limitations</span></a></span><a name=c2.1></a><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s2.2"></a><a
href="#s2.2"></a><a href="#s2.2"></a><a href="#s2.2"></a><a href="#s2.2"></a><a
href="#s2.2"></a><a href="#s2.2"></a><a href="#s2.2"></a><a href="#s2.2"></a><a
href="#s2.2"></a><a href="#s2.2"></a><a href="#s2.2"></a><a href="#s2.2"></a><a
href="#s2.2"></a><a href="#s2.2"></a><a href="#s2.2"></a><a href="#s2.2"></a><a
href="#s2.2"></a><a href="#s2.2"></a><a href="#s2.2"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>2.2. The Java Foreign View Approach</span></a></span><a
name=c2.2></a><span lang=DE style='mso-ansi-language:EN-GB'> </span><span
lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></p>

<p><a name=c14></a><a href="#s14"></a><a href="#s14"></a><a href="#s14"></a><a
href="#s14"></a><a href="#s14"></a><a href="#s14"></a><a href="#s14"></a><a
href="#s14"></a><a href="#s14"></a><a href="#s14"></a><a href="#s14"></a><a
href="#s14"></a><a href="#s14"></a><a href="#s14"></a><a href="#s14"></a><a
href="#s14"></a><a href="#s14"></a><a href="#s14"></a><a href="#s14"></a><a
href="#s14"><span style='mso-bookmark:c14'><span lang=EN-GB style='mso-ansi-language:
EN-GB'>3. C++: A Simple Example - The Vehicle Class</span></span><span
style='mso-bookmark:c14'></span></a><span style='mso-bookmark:c14'></span><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s14.1"></a><a
href="#s14.1"></a><a href="#s14.1"></a><a href="#s14.1"></a><a href="#s14.1"></a><a
href="#s14.1"></a><a href="#s14.1"></a><a href="#s14.1"></a><a href="#s14.1"></a><a
href="#s14.1"></a><a href="#s14.1"></a><a href="#s14.1"></a><a href="#s14.1"></a><a
href="#s14.1"></a><a href="#s14.1"></a><a href="#s14.1"></a><a href="#s14.1"></a><a
href="#s14.1"></a><a href="#s14.1"></a><a href="#s14.1"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>3.1. Initialize the Database</span></a></span><a
name=c14.1></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s14.2"></a><a
href="#s14.2"></a><a href="#s14.2"></a><a href="#s14.2"></a><a href="#s14.2"></a><a
href="#s14.2"></a><a href="#s14.2"></a><a href="#s14.2"></a><a href="#s14.2"></a><a
href="#s14.2"></a><a href="#s14.2"></a><a href="#s14.2"></a><a href="#s14.2"></a><a
href="#s14.2"></a><a href="#s14.2"></a><a href="#s14.2"></a><a href="#s14.2"></a><a
href="#s14.2"></a><a href="#s14.2"></a><a href="#s14.2"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>3.2. A Persistent C++ Class</span></a></span><a
name=c14.2></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s14.3"></a><a
href="#s14.3"></a><a href="#s14.3"></a><a href="#s14.3"></a><a href="#s14.3"></a><a
href="#s14.3"></a><a href="#s14.3"></a><a href="#s14.3"></a><a href="#s14.3"></a><a
href="#s14.3"></a><a href="#s14.3"></a><a href="#s14.3"></a><a href="#s14.3"></a><a
href="#s14.3"></a><a href="#s14.3"></a><a href="#s14.3"></a><a href="#s14.3"></a><a
href="#s14.3"></a><a href="#s14.3"></a><a href="#s14.3"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>3.3. The C++ Program</span></a></span><a
name=c14.3></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s14.3.1"></a><a
href="#s14.3.1"></a><a href="#s14.3.1"></a><a href="#s14.3.1"></a><a
href="#s14.3.1"></a><a href="#s14.3.1"></a><a href="#s14.3.1"></a><a
href="#s14.3.1"></a><a href="#s14.3.1"></a><a href="#s14.3.1"></a><a
href="#s14.3.1"></a><a href="#s14.3.1"></a><a href="#s14.3.1"></a><a
href="#s14.3.1"></a><a href="#s14.3.1"></a><a href="#s14.3.1"></a><a
href="#s14.3.1"></a><a href="#s14.3.1"></a><a href="#s14.3.1"></a><a
href="#s14.3.1"><span lang=EN-GB style='mso-ansi-language:EN-GB'>3.3.1. Vehicle
Methods</span></a></span><a name=c14.3.1></a><span lang=EN-GB style='mso-ansi-language:
EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s14.3.2"></a><a
href="#s14.3.2"></a><a href="#s14.3.2"></a><a href="#s14.3.2"></a><a
href="#s14.3.2"></a><a href="#s14.3.2"></a><a href="#s14.3.2"></a><a
href="#s14.3.2"></a><a href="#s14.3.2"></a><a href="#s14.3.2"></a><a
href="#s14.3.2"></a><a href="#s14.3.2"></a><a href="#s14.3.2"></a><a
href="#s14.3.2"></a><a href="#s14.3.2"></a><a href="#s14.3.2"></a><a
href="#s14.3.2"></a><a href="#s14.3.2"></a><a href="#s14.3.2"></a><a
href="#s14.3.2"><span lang=EN-GB style='mso-ansi-language:EN-GB'>3.3.2.
Creating the Schema</span></a></span><a name=c14.3.2></a><span lang=EN-GB
style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s14.3.3"></a><a
href="#s14.3.3"></a><a href="#s14.3.3"></a><a href="#s14.3.3"></a><a
href="#s14.3.3"></a><a href="#s14.3.3"></a><a href="#s14.3.3"></a><a
href="#s14.3.3"></a><a href="#s14.3.3"></a><a href="#s14.3.3"></a><a
href="#s14.3.3"></a><a href="#s14.3.3"></a><a href="#s14.3.3"></a><a
href="#s14.3.3"></a><a href="#s14.3.3"></a><a href="#s14.3.3"></a><a
href="#s14.3.3"></a><a href="#s14.3.3"></a><a href="#s14.3.3"></a><a
href="#s14.3.3"><span lang=EN-GB style='mso-ansi-language:EN-GB'>3.3.3. The C++
Program</span></a></span><a name=c14.3.3></a><span lang=DE style='mso-ansi-language:
EN-GB'> </span><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></p>

<p><a name=c15></a><a href="#s15"></a><a href="#s15"></a><a href="#s15"></a><a
href="#s15"></a><a href="#s15"></a><a href="#s15"></a><a href="#s15"></a><a
href="#s15"></a><a href="#s15"></a><a href="#s15"></a><a href="#s15"></a><a
href="#s15"></a><a href="#s15"></a><a href="#s15"></a><a href="#s15"></a><a
href="#s15"></a><a href="#s15"></a><a href="#s15"></a><a href="#s15"></a><a
href="#s15"><span style='mso-bookmark:c15'><span lang=EN-GB style='mso-ansi-language:
EN-GB'>4. C++: Sharing The Vehicle Class with JVI</span></span><span
style='mso-bookmark:c15'></span></a><span style='mso-bookmark:c15'></span><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s15.1"></a><a
href="#s15.1"></a><a href="#s15.1"></a><a href="#s15.1"></a><a href="#s15.1"></a><a
href="#s15.1"></a><a href="#s15.1"></a><a href="#s15.1"></a><a href="#s15.1"></a><a
href="#s15.1"></a><a href="#s15.1"></a><a href="#s15.1"></a><a href="#s15.1"></a><a
href="#s15.1"></a><a href="#s15.1"></a><a href="#s15.1"></a><a href="#s15.1"></a><a
href="#s15.1"></a><a href="#s15.1"></a><a href="#s15.1"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>4.1. Generating the View and Replacement Class</span></a></span><a
name=c15.1></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s15.2"></a><a
href="#s15.2"></a><a href="#s15.2"></a><a href="#s15.2"></a><a href="#s15.2"></a><a
href="#s15.2"></a><a href="#s15.2"></a><a href="#s15.2"></a><a href="#s15.2"></a><a
href="#s15.2"></a><a href="#s15.2"></a><a href="#s15.2"></a><a href="#s15.2"></a><a
href="#s15.2"></a><a href="#s15.2"></a><a href="#s15.2"></a><a href="#s15.2"></a><a
href="#s15.2"></a><a href="#s15.2"></a><a href="#s15.2"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>4.2. Using com.versant.Db2Java</span></a></span><a
name=c15.2></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s15.3"></a><a
href="#s15.3"></a><a href="#s15.3"></a><a href="#s15.3"></a><a href="#s15.3"></a><a
href="#s15.3"></a><a href="#s15.3"></a><a href="#s15.3"></a><a href="#s15.3"></a><a
href="#s15.3"></a><a href="#s15.3"></a><a href="#s15.3"></a><a href="#s15.3"></a><a
href="#s15.3"></a><a href="#s15.3"></a><a href="#s15.3"></a><a href="#s15.3"></a><a
href="#s15.3"></a><a href="#s15.3"></a><a href="#s15.3"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>4.3. Running com.versant.Db2Java on cppdb</span></a></span><a
name=c15.3></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s15.4"></a><a
href="#s15.4"></a><a href="#s15.4"></a><a href="#s15.4"></a><a href="#s15.4"></a><a
href="#s15.4"></a><a href="#s15.4"></a><a href="#s15.4"></a><a href="#s15.4"></a><a
href="#s15.4"></a><a href="#s15.4"></a><a href="#s15.4"></a><a href="#s15.4"></a><a
href="#s15.4"></a><a href="#s15.4"></a><a href="#s15.4"></a><a href="#s15.4"></a><a
href="#s15.4"></a><a href="#s15.4"></a><a href="#s15.4"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>4.4. View Classes for PObject, PVirtual and
Vehicle</span></a></span><a name=c15.4></a><span lang=EN-GB style='mso-ansi-language:
EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s15.5"></a><a
href="#s15.5"></a><a href="#s15.5"></a><a href="#s15.5"></a><a href="#s15.5"></a><a
href="#s15.5"></a><a href="#s15.5"></a><a href="#s15.5"></a><a href="#s15.5"></a><a
href="#s15.5"></a><a href="#s15.5"></a><a href="#s15.5"></a><a href="#s15.5"></a><a
href="#s15.5"></a><a href="#s15.5"></a><a href="#s15.5"></a><a href="#s15.5"></a><a
href="#s15.5"></a><a href="#s15.5"></a><a href="#s15.5"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>4.5. Replacement Classes for PObject, PVirtual
and Vehicle</span></a></span><a name=c15.5></a><span lang=EN-GB
style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s15.6"></a><a
href="#s15.6"></a><a href="#s15.6"></a><a href="#s15.6"></a><a href="#s15.6"></a><a
href="#s15.6"></a><a href="#s15.6"></a><a href="#s15.6"></a><a href="#s15.6"></a><a
href="#s15.6"></a><a href="#s15.6"></a><a href="#s15.6"></a><a href="#s15.6"></a><a
href="#s15.6"></a><a href="#s15.6"></a><a href="#s15.6"></a><a href="#s15.6"></a><a
href="#s15.6"></a><a href="#s15.6"></a><a href="#s15.6"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>4.6. Copying Prior to Pickling and After
Unpickling</span></a></span><a name=c15.6></a><span lang=EN-GB
style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s15.7"></a><a
href="#s15.7"></a><a href="#s15.7"></a><a href="#s15.7"></a><a href="#s15.7"></a><a
href="#s15.7"></a><a href="#s15.7"></a><a href="#s15.7"></a><a href="#s15.7"></a><a
href="#s15.7"></a><a href="#s15.7"></a><a href="#s15.7"></a><a href="#s15.7"></a><a
href="#s15.7"></a><a href="#s15.7"></a><a href="#s15.7"></a><a href="#s15.7"></a><a
href="#s15.7"></a><a href="#s15.7"></a><a href="#s15.7"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>4.7. The Transparent JVI Application</span></a></span><a
name=c15.7></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s15.8"></a><a
href="#s15.8"></a><a href="#s15.8"></a><a href="#s15.8"></a><a href="#s15.8"></a><a
href="#s15.8"></a><a href="#s15.8"></a><a href="#s15.8"></a><a href="#s15.8"></a><a
href="#s15.8"></a><a href="#s15.8"></a><a href="#s15.8"></a><a href="#s15.8"></a><a
href="#s15.8"></a><a href="#s15.8"></a><a href="#s15.8"></a><a href="#s15.8"></a><a
href="#s15.8"></a><a href="#s15.8"></a><a href="#s15.8"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>4.8. Compiling, Enhancing and Running your
Program</span></a></span><a name=c15.8></a><span lang=DE style='mso-ansi-language:
EN-GB'> </span><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></p>

<p><a name=c16></a><a href="#s16"></a><a href="#s16"></a><a href="#s16"></a><a
href="#s16"></a><a href="#s16"></a><a href="#s16"></a><a href="#s16"></a><a
href="#s16"></a><a href="#s16"></a><a href="#s16"></a><a href="#s16"></a><a
href="#s16"></a><a href="#s16"></a><a href="#s16"></a><a href="#s16"></a><a
href="#s16"></a><a href="#s16"></a><a href="#s16"></a><a href="#s16"></a><a
href="#s16"><span style='mso-bookmark:c16'><span lang=EN-GB style='mso-ansi-language:
EN-GB'>5. C++: Another Example - The Car Class</span></span><span
style='mso-bookmark:c16'></span></a><span style='mso-bookmark:c16'></span><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s16.1"></a><a
href="#s16.1"></a><a href="#s16.1"></a><a href="#s16.1"></a><a href="#s16.1"></a><a
href="#s16.1"></a><a href="#s16.1"></a><a href="#s16.1"></a><a href="#s16.1"></a><a
href="#s16.1"></a><a href="#s16.1"></a><a href="#s16.1"></a><a href="#s16.1"></a><a
href="#s16.1"></a><a href="#s16.1"></a><a href="#s16.1"></a><a href="#s16.1"></a><a
href="#s16.1"></a><a href="#s16.1"></a><a href="#s16.1"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>5.1. The C++ Car Class</span></a></span><a
name=c16.1></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s16.1.1"></a><a
href="#s16.1.1"></a><a href="#s16.1.1"></a><a href="#s16.1.1"></a><a
href="#s16.1.1"></a><a href="#s16.1.1"></a><a href="#s16.1.1"></a><a
href="#s16.1.1"></a><a href="#s16.1.1"></a><a href="#s16.1.1"></a><a
href="#s16.1.1"></a><a href="#s16.1.1"></a><a href="#s16.1.1"></a><a
href="#s16.1.1"></a><a href="#s16.1.1"></a><a href="#s16.1.1"></a><a
href="#s16.1.1"></a><a href="#s16.1.1"></a><a href="#s16.1.1"></a><a
href="#s16.1.1"><span lang=EN-GB style='mso-ansi-language:EN-GB'>5.1.1. Car
Methods</span></a></span><a name=c16.1.1></a><span lang=EN-GB style='mso-ansi-language:
EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s16.1.2"></a><a
href="#s16.1.2"></a><a href="#s16.1.2"></a><a href="#s16.1.2"></a><a
href="#s16.1.2"></a><a href="#s16.1.2"></a><a href="#s16.1.2"></a><a
href="#s16.1.2"></a><a href="#s16.1.2"></a><a href="#s16.1.2"></a><a
href="#s16.1.2"></a><a href="#s16.1.2"></a><a href="#s16.1.2"></a><a
href="#s16.1.2"></a><a href="#s16.1.2"></a><a href="#s16.1.2"></a><a
href="#s16.1.2"></a><a href="#s16.1.2"></a><a href="#s16.1.2"></a><a
href="#s16.1.2"><span lang=EN-GB style='mso-ansi-language:EN-GB'>5.1.2.
Creating the Schema</span></a></span><a name=c16.1.2></a><span lang=EN-GB
style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s16.1.3"></a><a
href="#s16.1.3"></a><a href="#s16.1.3"></a><a href="#s16.1.3"></a><a
href="#s16.1.3"></a><a href="#s16.1.3"></a><a href="#s16.1.3"></a><a
href="#s16.1.3"></a><a href="#s16.1.3"></a><a href="#s16.1.3"></a><a
href="#s16.1.3"></a><a href="#s16.1.3"></a><a href="#s16.1.3"></a><a
href="#s16.1.3"></a><a href="#s16.1.3"></a><a href="#s16.1.3"></a><a
href="#s16.1.3"></a><a href="#s16.1.3"></a><a href="#s16.1.3"></a><a
href="#s16.1.3"><span lang=EN-GB style='mso-ansi-language:EN-GB'>5.1.3. The C++
Program</span></a></span><a name=c16.1.3></a><span lang=DE style='mso-ansi-language:
EN-GB'> </span><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></p>

<p><a name=c17></a><a href="#s17"></a><a href="#s17"></a><a href="#s17"></a><a
href="#s17"></a><a href="#s17"></a><a href="#s17"></a><a href="#s17"></a><a
href="#s17"></a><a href="#s17"></a><a href="#s17"></a><a href="#s17"></a><a
href="#s17"></a><a href="#s17"></a><a href="#s17"></a><a href="#s17"></a><a
href="#s17"></a><a href="#s17"></a><a href="#s17"></a><a href="#s17"></a><a
href="#s17"><span style='mso-bookmark:c17'><span lang=EN-GB style='mso-ansi-language:
EN-GB'>6. C++: Sharing The Car Class with JVI</span></span><span
style='mso-bookmark:c17'></span></a><span style='mso-bookmark:c17'></span><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s17.1"></a><a
href="#s17.1"></a><a href="#s17.1"></a><a href="#s17.1"></a><a href="#s17.1"></a><a
href="#s17.1"></a><a href="#s17.1"></a><a href="#s17.1"></a><a href="#s17.1"></a><a
href="#s17.1"></a><a href="#s17.1"></a><a href="#s17.1"></a><a href="#s17.1"></a><a
href="#s17.1"></a><a href="#s17.1"></a><a href="#s17.1"></a><a href="#s17.1"></a><a
href="#s17.1"></a><a href="#s17.1"></a><a href="#s17.1"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>6.1. Generating the View and Replacement Class</span></a></span><a
name=c17.1></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s17.2"></a><a
href="#s17.2"></a><a href="#s17.2"></a><a href="#s17.2"></a><a href="#s17.2"></a><a
href="#s17.2"></a><a href="#s17.2"></a><a href="#s17.2"></a><a href="#s17.2"></a><a
href="#s17.2"></a><a href="#s17.2"></a><a href="#s17.2"></a><a href="#s17.2"></a><a
href="#s17.2"></a><a href="#s17.2"></a><a href="#s17.2"></a><a href="#s17.2"></a><a
href="#s17.2"></a><a href="#s17.2"></a><a href="#s17.2"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>6.2. Running com.versant.Db2Java on cppdb</span></a></span><a
name=c17.2></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s17.3"></a><a
href="#s17.3"></a><a href="#s17.3"></a><a href="#s17.3"></a><a href="#s17.3"></a><a
href="#s17.3"></a><a href="#s17.3"></a><a href="#s17.3"></a><a href="#s17.3"></a><a
href="#s17.3"></a><a href="#s17.3"></a><a href="#s17.3"></a><a href="#s17.3"></a><a
href="#s17.3"></a><a href="#s17.3"></a><a href="#s17.3"></a><a href="#s17.3"></a><a
href="#s17.3"></a><a href="#s17.3"></a><a href="#s17.3"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>6.3. View Class for Car</span></a></span><a
name=c17.3></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s17.4"></a><a
href="#s17.4"></a><a href="#s17.4"></a><a href="#s17.4"></a><a href="#s17.4"></a><a
href="#s17.4"></a><a href="#s17.4"></a><a href="#s17.4"></a><a href="#s17.4"></a><a
href="#s17.4"></a><a href="#s17.4"></a><a href="#s17.4"></a><a href="#s17.4"></a><a
href="#s17.4"></a><a href="#s17.4"></a><a href="#s17.4"></a><a href="#s17.4"></a><a
href="#s17.4"></a><a href="#s17.4"></a><a href="#s17.4"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>6.4. Replacement Class for Car</span></a></span><a
name=c17.4></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s17.5"></a><a
href="#s17.5"></a><a href="#s17.5"></a><a href="#s17.5"></a><a href="#s17.5"></a><a
href="#s17.5"></a><a href="#s17.5"></a><a href="#s17.5"></a><a href="#s17.5"></a><a
href="#s17.5"></a><a href="#s17.5"></a><a href="#s17.5"></a><a href="#s17.5"></a><a
href="#s17.5"></a><a href="#s17.5"></a><a href="#s17.5"></a><a href="#s17.5"></a><a
href="#s17.5"></a><a href="#s17.5"></a><a href="#s17.5"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>6.5. Copying Prior to Pickling and After
Unpickling</span></a></span><a name=c17.5></a><span lang=EN-GB
style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s17.6"></a><a
href="#s17.6"></a><a href="#s17.6"></a><a href="#s17.6"></a><a href="#s17.6"></a><a
href="#s17.6"></a><a href="#s17.6"></a><a href="#s17.6"></a><a href="#s17.6"></a><a
href="#s17.6"></a><a href="#s17.6"></a><a href="#s17.6"></a><a href="#s17.6"></a><a
href="#s17.6"></a><a href="#s17.6"></a><a href="#s17.6"></a><a href="#s17.6"></a><a
href="#s17.6"></a><a href="#s17.6"></a><a href="#s17.6"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>6.6. Adding Methods to Car</span></a></span><a
name=c17.6></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s17.7"></a><a
href="#s17.7"></a><a href="#s17.7"></a><a href="#s17.7"></a><a href="#s17.7"></a><a
href="#s17.7"></a><a href="#s17.7"></a><a href="#s17.7"></a><a href="#s17.7"></a><a
href="#s17.7"></a><a href="#s17.7"></a><a href="#s17.7"></a><a href="#s17.7"></a><a
href="#s17.7"></a><a href="#s17.7"></a><a href="#s17.7"></a><a href="#s17.7"></a><a
href="#s17.7"></a><a href="#s17.7"></a><a href="#s17.7"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>6.7. The Transparent JVI Application</span></a></span><a
name=c17.7></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s17.8"></a><a
href="#s17.8"></a><a href="#s17.8"></a><a href="#s17.8"></a><a href="#s17.8"></a><a
href="#s17.8"></a><a href="#s17.8"></a><a href="#s17.8"></a><a href="#s17.8"></a><a
href="#s17.8"></a><a href="#s17.8"></a><a href="#s17.8"></a><a href="#s17.8"></a><a
href="#s17.8"></a><a href="#s17.8"></a><a href="#s17.8"></a><a href="#s17.8"></a><a
href="#s17.8"></a><a href="#s17.8"></a><a href="#s17.8"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>6.8. Compiling, Enhancing and Running your
Program</span></a></span><a name=c17.8></a><span lang=DE style='mso-ansi-language:
EN-GB'> </span><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></p>

<p><a name=c18></a><a href="#s18"></a><a href="#s18"></a><a href="#s18"></a><a
href="#s18"></a><a href="#s18"></a><a href="#s18"></a><a href="#s18"></a><a
href="#s18"></a><a href="#s18"></a><a href="#s18"></a><a href="#s18"></a><a
href="#s18"></a><a href="#s18"></a><a href="#s18"></a><a href="#s18"></a><a
href="#s18"></a><a href="#s18"></a><a href="#s18"></a><a href="#s18"></a><a
href="#s18"><span style='mso-bookmark:c18'><span lang=EN-GB style='mso-ansi-language:
EN-GB'>7. C++: Types to View Class Mapping</span></span><span style='mso-bookmark:
c18'></span></a><span style='mso-bookmark:c18'></span><span style='mso-ansi-language:
EN-GB'> <span lang=EN-GB><o:p></o:p></span></span></p>

<p><a name=c19></a><a href="#s19"></a><a href="#s19"></a><a href="#s19"></a><a
href="#s19"></a><a href="#s19"></a><a href="#s19"></a><a href="#s19"></a><a
href="#s19"></a><a href="#s19"></a><a href="#s19"></a><a href="#s19"></a><a
href="#s19"></a><a href="#s19"></a><a href="#s19"></a><a href="#s19"></a><a
href="#s19"></a><a href="#s19"></a><a href="#s19"></a><a href="#s19"></a><a
href="#s19"><span style='mso-bookmark:c19'><span lang=EN-GB style='mso-ansi-language:
EN-GB'>8. C++: Sharing C++ Template Collection Classes</span></span><span
style='mso-bookmark:c19'></span></a><span style='mso-bookmark:c19'></span><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s19.1"></a><a
href="#s19.1"></a><a href="#s19.1"></a><a href="#s19.1"></a><a href="#s19.1"></a><a
href="#s19.1"></a><a href="#s19.1"></a><a href="#s19.1"></a><a href="#s19.1"></a><a
href="#s19.1"></a><a href="#s19.1"></a><a href="#s19.1"></a><a href="#s19.1"></a><a
href="#s19.1"></a><a href="#s19.1"></a><a href="#s19.1"></a><a href="#s19.1"></a><a
href="#s19.1"></a><a href="#s19.1"></a><a href="#s19.1"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>8.1. C++ to Java Class and Attribute Name
Mappings</span></a></span><a name=c19.1></a><span lang=DE style='mso-ansi-language:
EN-GB'> </span><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></p>

<p><a name=c20></a><a href="#s20"></a><a href="#s20"></a><a href="#s20"></a><a
href="#s20"></a><a href="#s20"></a><a href="#s20"></a><a href="#s20"></a><a
href="#s20"></a><a href="#s20"></a><a href="#s20"></a><a href="#s20"></a><a
href="#s20"></a><a href="#s20"></a><a href="#s20"></a><a href="#s20"></a><a
href="#s20"></a><a href="#s20"></a><a href="#s20"></a><a href="#s20"></a><a
href="#s20"><span style='mso-bookmark:c20'><span lang=EN-GB style='mso-ansi-language:
EN-GB'>9. C++: Collections Example - The FloorPlan and Employee Classes</span></span><span
style='mso-bookmark:c20'></span></a><span style='mso-bookmark:c20'></span><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s20.1"></a><a
href="#s20.1"></a><a href="#s20.1"></a><a href="#s20.1"></a><a href="#s20.1"></a><a
href="#s20.1"></a><a href="#s20.1"></a><a href="#s20.1"></a><a href="#s20.1"></a><a
href="#s20.1"></a><a href="#s20.1"></a><a href="#s20.1"></a><a href="#s20.1"></a><a
href="#s20.1"></a><a href="#s20.1"></a><a href="#s20.1"></a><a href="#s20.1"></a><a
href="#s20.1"></a><a href="#s20.1"></a><a href="#s20.1"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>9.1. The C++ FloorPlan and Employee Class</span></a></span><a
name=c20.1></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s20.2"></a><a
href="#s20.2"></a><a href="#s20.2"></a><a href="#s20.2"></a><a href="#s20.2"></a><a
href="#s20.2"></a><a href="#s20.2"></a><a href="#s20.2"></a><a href="#s20.2"></a><a
href="#s20.2"></a><a href="#s20.2"></a><a href="#s20.2"></a><a href="#s20.2"></a><a
href="#s20.2"></a><a href="#s20.2"></a><a href="#s20.2"></a><a href="#s20.2"></a><a
href="#s20.2"></a><a href="#s20.2"></a><a href="#s20.2"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>9.2. FloorPlan Methods</span></a></span><a
name=c20.2></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s20.2.1"></a><a
href="#s20.2.1"></a><a href="#s20.2.1"></a><a href="#s20.2.1"></a><a
href="#s20.2.1"></a><a href="#s20.2.1"></a><a href="#s20.2.1"></a><a
href="#s20.2.1"></a><a href="#s20.2.1"></a><a href="#s20.2.1"></a><a
href="#s20.2.1"></a><a href="#s20.2.1"></a><a href="#s20.2.1"></a><a
href="#s20.2.1"></a><a href="#s20.2.1"></a><a href="#s20.2.1"></a><a
href="#s20.2.1"></a><a href="#s20.2.1"></a><a href="#s20.2.1"></a><a
href="#s20.2.1"><span lang=EN-GB style='mso-ansi-language:EN-GB'>9.2.1.
Creating the Schema</span></a></span><a name=c20.2.1></a><span lang=EN-GB
style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s20.2.2"></a><a
href="#s20.2.2"></a><a href="#s20.2.2"></a><a href="#s20.2.2"></a><a
href="#s20.2.2"></a><a href="#s20.2.2"></a><a href="#s20.2.2"></a><a
href="#s20.2.2"></a><a href="#s20.2.2"></a><a href="#s20.2.2"></a><a
href="#s20.2.2"></a><a href="#s20.2.2"></a><a href="#s20.2.2"></a><a
href="#s20.2.2"></a><a href="#s20.2.2"></a><a href="#s20.2.2"></a><a
href="#s20.2.2"></a><a href="#s20.2.2"></a><a href="#s20.2.2"></a><a
href="#s20.2.2"><span lang=EN-GB style='mso-ansi-language:EN-GB'>9.2.2. The C++
Program</span></a></span><a name=c20.2.2></a><span lang=DE style='mso-ansi-language:
EN-GB'> </span><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></p>

<p><a name=c21></a><a href="#s21"></a><a href="#s21"></a><a href="#s21"></a><a
href="#s21"></a><a href="#s21"></a><a href="#s21"></a><a href="#s21"></a><a
href="#s21"></a><a href="#s21"></a><a href="#s21"></a><a href="#s21"></a><a
href="#s21"></a><a href="#s21"></a><a href="#s21"></a><a href="#s21"></a><a
href="#s21"></a><a href="#s21"></a><a href="#s21"></a><a href="#s21"></a><a
href="#s21"><span style='mso-bookmark:c21'><span lang=EN-GB style='mso-ansi-language:
EN-GB'>10. C++: Sharing The FloorPlan and Employee Classes with JVI</span></span><span
style='mso-bookmark:c21'></span></a><span style='mso-bookmark:c21'></span><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s21.1"></a><a
href="#s21.1"></a><a href="#s21.1"></a><a href="#s21.1"></a><a href="#s21.1"></a><a
href="#s21.1"></a><a href="#s21.1"></a><a href="#s21.1"></a><a href="#s21.1"></a><a
href="#s21.1"></a><a href="#s21.1"></a><a href="#s21.1"></a><a href="#s21.1"></a><a
href="#s21.1"></a><a href="#s21.1"></a><a href="#s21.1"></a><a href="#s21.1"></a><a
href="#s21.1"></a><a href="#s21.1"></a><a href="#s21.1"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>10.1. Generating the View and Replacement Class</span></a></span><a
name=c21.1></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s21.2"></a><a
href="#s21.2"></a><a href="#s21.2"></a><a href="#s21.2"></a><a href="#s21.2"></a><a
href="#s21.2"></a><a href="#s21.2"></a><a href="#s21.2"></a><a href="#s21.2"></a><a
href="#s21.2"></a><a href="#s21.2"></a><a href="#s21.2"></a><a href="#s21.2"></a><a
href="#s21.2"></a><a href="#s21.2"></a><a href="#s21.2"></a><a href="#s21.2"></a><a
href="#s21.2"></a><a href="#s21.2"></a><a href="#s21.2"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>10.2. Running com.versant.Db2Java on cppdb</span></a></span><a
name=c21.2></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s21.3"></a><a
href="#s21.3"></a><a href="#s21.3"></a><a href="#s21.3"></a><a href="#s21.3"></a><a
href="#s21.3"></a><a href="#s21.3"></a><a href="#s21.3"></a><a href="#s21.3"></a><a
href="#s21.3"></a><a href="#s21.3"></a><a href="#s21.3"></a><a href="#s21.3"></a><a
href="#s21.3"></a><a href="#s21.3"></a><a href="#s21.3"></a><a href="#s21.3"></a><a
href="#s21.3"></a><a href="#s21.3"></a><a href="#s21.3"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>10.3. View Class for FloorPlan</span></a></span><a
name=c21.3></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s21.4"></a><a
href="#s21.4"></a><a href="#s21.4"></a><a href="#s21.4"></a><a href="#s21.4"></a><a
href="#s21.4"></a><a href="#s21.4"></a><a href="#s21.4"></a><a href="#s21.4"></a><a
href="#s21.4"></a><a href="#s21.4"></a><a href="#s21.4"></a><a href="#s21.4"></a><a
href="#s21.4"></a><a href="#s21.4"></a><a href="#s21.4"></a><a href="#s21.4"></a><a
href="#s21.4"></a><a href="#s21.4"></a><a href="#s21.4"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>10.4. Replacement Class for FloorPlan</span></a></span><a
name=c21.4></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s21.5"></a><a
href="#s21.5"></a><a href="#s21.5"></a><a href="#s21.5"></a><a href="#s21.5"></a><a
href="#s21.5"></a><a href="#s21.5"></a><a href="#s21.5"></a><a href="#s21.5"></a><a
href="#s21.5"></a><a href="#s21.5"></a><a href="#s21.5"></a><a href="#s21.5"></a><a
href="#s21.5"></a><a href="#s21.5"></a><a href="#s21.5"></a><a href="#s21.5"></a><a
href="#s21.5"></a><a href="#s21.5"></a><a href="#s21.5"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>10.5. Copying Prior to Pickling and After
Unpickling</span></a></span><a name=c21.5></a><span lang=EN-GB
style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s21.6"></a><a
href="#s21.6"></a><a href="#s21.6"></a><a href="#s21.6"></a><a href="#s21.6"></a><a
href="#s21.6"></a><a href="#s21.6"></a><a href="#s21.6"></a><a href="#s21.6"></a><a
href="#s21.6"></a><a href="#s21.6"></a><a href="#s21.6"></a><a href="#s21.6"></a><a
href="#s21.6"></a><a href="#s21.6"></a><a href="#s21.6"></a><a href="#s21.6"></a><a
href="#s21.6"></a><a href="#s21.6"></a><a href="#s21.6"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>10.6. The Transparent JVI Application</span></a></span><a
name=c21.6></a><span lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><span lang=DE style='mso-ansi-language:DE'><a href="#s21.7"></a><a
href="#s21.7"></a><a href="#s21.7"></a><a href="#s21.7"></a><a href="#s21.7"></a><a
href="#s21.7"></a><a href="#s21.7"></a><a href="#s21.7"></a><a href="#s21.7"></a><a
href="#s21.7"></a><a href="#s21.7"></a><a href="#s21.7"></a><a href="#s21.7"></a><a
href="#s21.7"></a><a href="#s21.7"></a><a href="#s21.7"></a><a href="#s21.7"></a><a
href="#s21.7"></a><a href="#s21.7"></a><a href="#s21.7"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>10.7. Compiling, Enhancing and Running your
Program</span></a></span><a name=c21.7></a><span lang=DE style='mso-ansi-language:
EN-GB'> </span><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></p>

<p><a name=c22></a><a href="#s22"></a><a href="#s22"></a><a href="#s22"></a><a
href="#s22"></a><a href="#s22"></a><a href="#s22"></a><a href="#s22"></a><a
href="#s22"></a><a href="#s22"></a><a href="#s22"></a><a href="#s22"></a><a
href="#s22"></a><a href="#s22"></a><a href="#s22"></a><a href="#s22"></a><a
href="#s22"></a><a href="#s22"></a><a href="#s22"></a><a href="#s22"></a><a
href="#s22"><span style='mso-bookmark:c22'><span lang=EN-GB style='mso-ansi-language:
EN-GB'>11. com.versant.Db2Java Usage Notes</span></span><span style='mso-bookmark:
c22'></span></a><span style='mso-bookmark:c22'></span><span style='mso-ansi-language:
EN-GB'> <span lang=EN-GB><o:p></o:p></span></span></p>


<div class=MsoNormal align=center style='text-align:center'><span lang=DE
style='mso-ansi-language:DE'>

<hr size=2 width="100%" align=center>

</span></div>


<h1><a name=s1 XXREF="#c1"></a><a href="#top"><span style='mso-bookmark:s1'></span></a><span
style='mso-bookmark:s1'></span><a href="#top" XXREF="#c1"><span
style='mso-bookmark:s1'></span></a><span style='mso-bookmark:s1'></span><a
href="#top" XXREF="#c1"><span style='mso-bookmark:s1'></span></a><span
style='mso-bookmark:s1'></span><a href="#top" XXREF="#c1"><span
style='mso-bookmark:s1'></span></a><span style='mso-bookmark:s1'></span><a
href="#top" XXREF="#c1"><span style='mso-bookmark:s1'></span></a><span
style='mso-bookmark:s1'></span><a href="#top" XXREF="#c1"><span
style='mso-bookmark:s1'></span></a><span style='mso-bookmark:s1'></span><a
href="#top" XXREF="#c1"><span style='mso-bookmark:s1'></span></a><span
style='mso-bookmark:s1'></span><a href="#top" XXREF="#c1"><span
style='mso-bookmark:s1'></span></a><span style='mso-bookmark:s1'></span><a
href="#top" XXREF="#c1"><span style='mso-bookmark:s1'></span></a><span
style='mso-bookmark:s1'></span><a href="#top" XXREF="#c1"><span
style='mso-bookmark:s1'></span></a><span style='mso-bookmark:s1'></span><a
href="#top" XXREF="#c1"><span style='mso-bookmark:s1'></span></a><span
style='mso-bookmark:s1'></span><a href="#top" XXREF="#c1"><span
style='mso-bookmark:s1'></span></a><span style='mso-bookmark:s1'></span><a
href="#top" XXREF="#c1"><span style='mso-bookmark:s1'></span></a><span
style='mso-bookmark:s1'></span><a href="#top" XXREF="#c1"><span
style='mso-bookmark:s1'></span></a><span style='mso-bookmark:s1'></span><a
href="#top" XXREF="#c1"><span style='mso-bookmark:s1'></span></a><span
style='mso-bookmark:s1'></span><a href="#top" XXREF="#c1"><span
style='mso-bookmark:s1'></span></a><span style='mso-bookmark:s1'></span><a
href="#top" XXREF="#c1"><span style='mso-bookmark:s1'></span></a><span
style='mso-bookmark:s1'></span><a href="#top" XXREF="#c1"><span
style='mso-bookmark:s1'></span></a><span style='mso-bookmark:s1'></span><a
href="#top" XXREF="#c1"><span style='mso-bookmark:s1'></span></a><span
style='mso-bookmark:s1'></span><a href="#top" XXREF="#c1"><span
style='mso-bookmark:s1'><span lang=EN-GB style='mso-ansi-language:EN-GB'>Chapter
1.</span></span><span style='mso-bookmark:s1'></span></a><span
style='mso-bookmark:s1'></span><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;
Introduction<o:p></o:p></span></h1>

<p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>This
tutorial contains examples and explains how a JVI program using the transparent
package can <o:p></o:p></span></p>

<ul type=disc>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l2 level1 lfo3;tab-stops:list .5in'><span lang=EN-GB
     style='mso-ansi-language:EN-GB'>access and modify objects created from
     another language<o:p></o:p></span></li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l2 level1 lfo3;tab-stops:list .5in'><span lang=EN-GB
     style='mso-ansi-language:EN-GB'>create new persistent objects for a schema
     defined from another language.<o:p></o:p></span></li>
</ul>

<p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>We assume
that you have some general familiarity with writing Transparent Java programs
using JVI. At the least, you need to be comfortable with the extent of JVI
usage covered in Chapter 3 <i>Tutorial for Transparent Package </i>in the <i>JVI
Usage Manual.</i> <o:p></o:p></span></p>

<p><span lang=EN-GB style='mso-ansi-language:EN-GB'>In presenting C++ examples,
we assume that you are familiar with using the VERSANT C++ language interfaces
to create and access persistent objects using C++. <o:p></o:p></span></p>


<div class=MsoNormal align=center style='text-align:center'><span lang=DE
style='mso-ansi-language:DE'>

<hr size=2 width="100%" align=center>

</span></div>


<h1><a name=s2 XXREF="#c2"></a><a href="#top"><span style='mso-bookmark:s2'></span></a><span
style='mso-bookmark:s2'></span><a href="#top" XXREF="#c2"><span
style='mso-bookmark:s2'></span></a><span style='mso-bookmark:s2'></span><a
href="#top" XXREF="#c2"><span style='mso-bookmark:s2'></span></a><span
style='mso-bookmark:s2'></span><a href="#top" XXREF="#c2"><span
style='mso-bookmark:s2'></span></a><span style='mso-bookmark:s2'></span><a
href="#top" XXREF="#c2"><span style='mso-bookmark:s2'></span></a><span
style='mso-bookmark:s2'></span><a href="#top" XXREF="#c2"><span
style='mso-bookmark:s2'></span></a><span style='mso-bookmark:s2'></span><a
href="#top" XXREF="#c2"><span style='mso-bookmark:s2'></span></a><span
style='mso-bookmark:s2'></span><a href="#top" XXREF="#c2"><span
style='mso-bookmark:s2'></span></a><span style='mso-bookmark:s2'></span><a
href="#top" XXREF="#c2"><span style='mso-bookmark:s2'></span></a><span
style='mso-bookmark:s2'></span><a href="#top" XXREF="#c2"><span
style='mso-bookmark:s2'></span></a><span style='mso-bookmark:s2'></span><a
href="#top" XXREF="#c2"><span style='mso-bookmark:s2'></span></a><span
style='mso-bookmark:s2'></span><a href="#top" XXREF="#c2"><span
style='mso-bookmark:s2'></span></a><span style='mso-bookmark:s2'></span><a
href="#top" XXREF="#c2"><span style='mso-bookmark:s2'></span></a><span
style='mso-bookmark:s2'></span><a href="#top" XXREF="#c2"><span
style='mso-bookmark:s2'></span></a><span style='mso-bookmark:s2'></span><a
href="#top" XXREF="#c2"><span style='mso-bookmark:s2'></span></a><span
style='mso-bookmark:s2'></span><a href="#top" XXREF="#c2"><span
style='mso-bookmark:s2'></span></a><span style='mso-bookmark:s2'></span><a
href="#top" XXREF="#c2"><span style='mso-bookmark:s2'></span></a><span
style='mso-bookmark:s2'></span><a href="#top" XXREF="#c2"><span
style='mso-bookmark:s2'></span></a><span style='mso-bookmark:s2'></span><a
href="#top" XXREF="#c2"><span style='mso-bookmark:s2'></span></a><span
style='mso-bookmark:s2'></span><a href="#top" XXREF="#c2"><span
style='mso-bookmark:s2'><span lang=EN-GB style='mso-ansi-language:EN-GB'>Chapter
2.</span></span><span style='mso-bookmark:s2'></span></a><span
style='mso-bookmark:s2'></span><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;
Basic Concepts<o:p></o:p></span></h1>

<h2><span lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c2.1"></a><a
href="#top" XXREF="#c2.1"></a><a href="#top" XXREF="#c2.1"></a><a href="#top"
XXREF="#c2.1"></a><a href="#top" XXREF="#c2.1"></a><a href="#top" XXREF="#c2.1"></a><a
href="#top" XXREF="#c2.1"></a><a href="#top" XXREF="#c2.1"></a><a href="#top"
XXREF="#c2.1"></a><a href="#top" XXREF="#c2.1"></a><a href="#top" XXREF="#c2.1"></a><a
href="#top" XXREF="#c2.1"></a><a href="#top" XXREF="#c2.1"></a><a href="#top"
XXREF="#c2.1"></a><a href="#top" XXREF="#c2.1"></a><a href="#top" XXREF="#c2.1"></a><a
href="#top" XXREF="#c2.1"></a><a href="#top" XXREF="#c2.1"></a><a href="#top"
XXREF="#c2.1"></a><a href="#top" XXREF="#c2.1"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>2.1.</span></a></span><a name=s2.1></a><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp; Limitations<o:p></o:p></span></h2>

<p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>There are
two basic assumptions that we work with when sharing objects with a Transparent
JVI program. <o:p></o:p></span></p>

<ul type=disc>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l3 level1 lfo6;tab-stops:list .5in'><span lang=EN-GB
     style='mso-ansi-language:EN-GB'>The object sharing is one-directional.
     This means your Transparent JVI program can access database schema for a
     class created from a language other then Java. We <b>do not </b>address
     the converse - sharing the schema of a class defined from a Transparent
     JVI program with other languages is not considered.<o:p></o:p></span></li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l3 level1 lfo6;tab-stops:list .5in'><span lang=EN-GB
     style='mso-ansi-language:EN-GB'>We provide support for transparent sharing
     of the attributes (data fields) of objects, <b>not </b>their methods.
     However, you may write methods in Java for the external classes being
     shared. </span><span lang=DE style='mso-ansi-language:DE'>The is described
     in the course of this tutorial.<o:p></o:p></span></li>
</ul>

<h2><span lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c2.2"></a><a
href="#top" XXREF="#c2.2"></a><a href="#top" XXREF="#c2.2"></a><a href="#top"
XXREF="#c2.2"></a><a href="#top" XXREF="#c2.2"></a><a href="#top" XXREF="#c2.2"></a><a
href="#top" XXREF="#c2.2"></a><a href="#top" XXREF="#c2.2"></a><a href="#top"
XXREF="#c2.2"></a><a href="#top" XXREF="#c2.2"></a><a href="#top" XXREF="#c2.2"></a><a
href="#top" XXREF="#c2.2"></a><a href="#top" XXREF="#c2.2"></a><a href="#top"
XXREF="#c2.2"></a><a href="#top" XXREF="#c2.2"></a><a href="#top" XXREF="#c2.2"></a><a
href="#top" XXREF="#c2.2"></a><a href="#top" XXREF="#c2.2"></a><a href="#top"
XXREF="#c2.2"></a><a href="#top" XXREF="#c2.2">2.2.</a><a name=s2.2></a>&nbsp;&nbsp;
The Java Foreign View Approach<o:p></o:p></span></h2>

<p class=MsoNormal><b><span lang=DE style='mso-ansi-language:DE'>Foreign
Language</span></b><span lang=DE style='mso-ansi-language:DE'> <o:p></o:p></span></p>

<p><span lang=EN-GB style='mso-ansi-language:EN-GB'>The term <i>Foreign </i>refers
to the external language from which the schema of a class is defined.
Currently, the foreign language we support for object sharing with JVI is <o:p></o:p></span></p>

<ul type=disc>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l0 level1 lfo9;tab-stops:list .5in'><span lang=DE
     style='mso-ansi-language:DE'>C++<o:p></o:p></span></li>
</ul>

<p class=MsoNormal><b><span lang=DE style='mso-ansi-language:DE'>Transparency
and Object Sharing</span></b><span lang=DE style='mso-ansi-language:DE'> <o:p></o:p></span></p>

<p><span lang=EN-GB style='mso-ansi-language:EN-GB'>Recall that to create a
persistent Java class using JVI you first create a </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>.java
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>file that defines
and implements the persistent class. Then you compile and enhance the class
file. The enhancement process automatically incorporates changes needed to
allow objects of the class to be stored in the database.Before running the
Enhancer please make sure the </span><tt><span lang=EN-GB style='font-size:
10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>CLASSPATH </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>is set properly. <o:p></o:p></span></p>

<p><span lang=EN-GB style='mso-ansi-language:EN-GB'>In the Object Sharing
support we provide, we work under the same paradigm. Our goal is to provide the
same level of convenience through transparent access to schema defined from a
foreign language as we do for class schema defined from Java. <o:p></o:p></span></p>

<p><span lang=EN-GB style='mso-ansi-language:EN-GB'>An object sharing support
tool creates Java classes, by providing you with </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>.java
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>files. These
contain source code for the classes defined to the database from a foreign
language. You can then use these classes and compile and enhance them together
with your Transparent JVI program. You can treat the class created for the
foreign language schema just like any another persistent Java class. <o:p></o:p></span></p>

<p><span lang=EN-GB style='mso-ansi-language:EN-GB'>To start a session in
transparent JVI applications for java foreign view approach instead of a
default standard session, set the session property by name &quot;useJFV&quot;
to value &quot;true&quot; when you create a session object. <o:p></o:p></span></p>

<p><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>View and Replacement
Classes</span></b><span lang=EN-GB style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<p><span lang=EN-GB style='mso-ansi-language:EN-GB'>A JVI programmer can use
the </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>Db2Java </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>tool to generate Java files from the database corresponding to class
schema defined from a foreign language. This tool, </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>com.versant.Db2Java
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>is a Java program
that reads the database schema and creates two </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>.java
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>source files. One
file corresponds to the transparent class being shared. We call this the <i>View
</i>class because it presents a Java JVI programmer a Java-centric view of the
class being shared. <o:p></o:p></span></p>

<pre><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;------------------&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>| VERSANT Database |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ----------------&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp; CPP1.java&nbsp;&nbsp;&nbsp; |&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /---&gt; |&nbsp;&nbsp;&nbsp; (source)&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |/* View class */|&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>| C++ Class CPP1&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ----------------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | java com.versant.Db2Java&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; &lt;arguments&gt;&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ----------------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | CPP1_Rep.java&nbsp; |&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; (source)&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \---&gt; |/* Replacement&nbsp; |&nbsp;&nbsp;&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp; class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */|&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;------------------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ----------------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1. Add methods if needed.<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2. Compile.<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3. Write JVI application classes.<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4. Compile and Enhance all class files.<o:p></o:p></span></pre><pre><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5. Run application.<o:p></o:p></span></pre>

<p class=MsoNormal style='tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The other file that we generate is
called the <i>Replacement </i>class. This class bears a close correspondence
with the View class. It encapsulates a direct correspondence with the schema
present in the database. While the View class contains attribute names and
types that a Java and JVI programmer would be familiar with, the Replacement
class contains attributes aligned with their type in the database. The
Replacement class also contains methods to transform the attributes of the View
class with the attributes of the Replacement class and vice-versa. <o:p></o:p></span></p>

<p style='tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>For most cases of object sharing, you
need to be familiar with the structure of the View class. The Replacement class
serves to read and write shared objects from and to the database correctly. You
must refer to the View class in your transparent JVI program. When you compile
your application, you must also compile the View and Replacement classes. The
enhancement must also include the compiled View and Replacement classes
together with your application classes. <br>
&nbsp; <o:p></o:p></span></p>


<h1 align=center style='text-align:center;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'>

<hr size=2 width="100%" align=center>

</span></h1>


<h1 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><a
name=s14 XXREF="#c14"></a><a href="#top"><span style='mso-bookmark:s14'></span></a><span
style='mso-bookmark:s14'></span><a href="#top" XXREF="#c14"><span
style='mso-bookmark:s14'></span></a><span style='mso-bookmark:s14'></span><a
href="#top" XXREF="#c14"><span style='mso-bookmark:s14'></span></a><span
style='mso-bookmark:s14'></span><a href="#top" XXREF="#c14"><span
style='mso-bookmark:s14'></span></a><span style='mso-bookmark:s14'></span><a
href="#top" XXREF="#c14"><span style='mso-bookmark:s14'></span></a><span
style='mso-bookmark:s14'></span><a href="#top" XXREF="#c14"><span
style='mso-bookmark:s14'></span></a><span style='mso-bookmark:s14'></span><a
href="#top" XXREF="#c14"><span style='mso-bookmark:s14'></span></a><span
style='mso-bookmark:s14'></span><a href="#top" XXREF="#c14"><span
style='mso-bookmark:s14'></span></a><span style='mso-bookmark:s14'></span><a
href="#top" XXREF="#c14"><span style='mso-bookmark:s14'></span></a><span
style='mso-bookmark:s14'></span><a href="#top" XXREF="#c14"><span
style='mso-bookmark:s14'></span></a><span style='mso-bookmark:s14'></span><a
href="#top" XXREF="#c14"><span style='mso-bookmark:s14'></span></a><span
style='mso-bookmark:s14'></span><a href="#top" XXREF="#c14"><span
style='mso-bookmark:s14'></span></a><span style='mso-bookmark:s14'></span><a
href="#top" XXREF="#c14"><span style='mso-bookmark:s14'></span></a><span
style='mso-bookmark:s14'></span><a href="#top" XXREF="#c14"><span
style='mso-bookmark:s14'></span></a><span style='mso-bookmark:s14'></span><a
href="#top" XXREF="#c14"><span style='mso-bookmark:s14'></span></a><span
style='mso-bookmark:s14'></span><a href="#top" XXREF="#c14"><span
style='mso-bookmark:s14'></span></a><span style='mso-bookmark:s14'></span><a
href="#top" XXREF="#c14"><span style='mso-bookmark:s14'></span></a><span
style='mso-bookmark:s14'></span><a href="#top" XXREF="#c14"><span
style='mso-bookmark:s14'></span></a><span style='mso-bookmark:s14'></span><a
href="#top" XXREF="#c14"><span style='mso-bookmark:s14'></span></a><span
style='mso-bookmark:s14'></span><a href="#top" XXREF="#c14"><span
style='mso-bookmark:s14'><span lang=EN-GB style='mso-ansi-language:EN-GB'>Chapter
3.</span></span><span style='mso-bookmark:s14'></span></a><span
style='mso-bookmark:s14'></span><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;
C++: A Simple Example - The Vehicle Class<o:p></o:p></span></h1>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>We present a simple C++ example. We
do not get into the details of the VERSANT/C++ interface. You are expected to
have some familiarity with creating classes from VERSANT/C++ and understand how
to use the C++ collection library. For further details, please refer to the <i>VERSANT
C++ Reference Manual.</i> <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>All the examples in this tutorial
utilize a database in which we store persistent objects. We call this database </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>cppdb </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>and
you are free to change the name since it is passed in as a command line
parameter in all the example programs. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:3.5in'><span lang=EN-GB style='mso-ansi-language:
EN-GB'>The examples can be found in your
&lt;VERSANT_ROOT&gt;/demo/jvi/advanced/</span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>sharing/cpp/in/
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>directory. <o:p></o:p></span></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c14.1"></a><a
href="#top" XXREF="#c14.1"></a><a href="#top" XXREF="#c14.1"></a><a href="#top"
XXREF="#c14.1"></a><a href="#top" XXREF="#c14.1"></a><a href="#top"
XXREF="#c14.1"></a><a href="#top" XXREF="#c14.1"></a><a href="#top"
XXREF="#c14.1"></a><a href="#top" XXREF="#c14.1"></a><a href="#top"
XXREF="#c14.1"></a><a href="#top" XXREF="#c14.1"></a><a href="#top"
XXREF="#c14.1"></a><a href="#top" XXREF="#c14.1"></a><a href="#top"
XXREF="#c14.1"></a><a href="#top" XXREF="#c14.1"></a><a href="#top"
XXREF="#c14.1"></a><a href="#top" XXREF="#c14.1"></a><a href="#top"
XXREF="#c14.1"></a><a href="#top" XXREF="#c14.1"></a><a href="#top"
XXREF="#c14.1"><span lang=EN-GB style='mso-ansi-language:EN-GB'>3.1.</span></a></span><a
name=s14.1></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Initialize the Database<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>You must first create a database
directory and then create a database using the standard Versant utilities. We
mentioned that we would call our database </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>cppdb
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>so you need to do
the following: <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>makedb cppdb</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>
<o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>This creates a sub-directory under
the VERSANT root directory in which you will be creating the database. The next
step shown below creates the database system storage and log files. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>createdb cppdb</span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'> <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>cppdb </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>is
now initialized and ready to be used to store persistent objects. <o:p></o:p></span></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c14.2"></a><a
href="#top" XXREF="#c14.2"></a><a href="#top" XXREF="#c14.2"></a><a href="#top"
XXREF="#c14.2"></a><a href="#top" XXREF="#c14.2"></a><a href="#top"
XXREF="#c14.2"></a><a href="#top" XXREF="#c14.2"></a><a href="#top"
XXREF="#c14.2"></a><a href="#top" XXREF="#c14.2"></a><a href="#top"
XXREF="#c14.2"></a><a href="#top" XXREF="#c14.2"></a><a href="#top"
XXREF="#c14.2"></a><a href="#top" XXREF="#c14.2"></a><a href="#top"
XXREF="#c14.2"></a><a href="#top" XXREF="#c14.2"></a><a href="#top"
XXREF="#c14.2"></a><a href="#top" XXREF="#c14.2"></a><a href="#top"
XXREF="#c14.2"></a><a href="#top" XXREF="#c14.2"></a><a href="#top"
XXREF="#c14.2"><span lang=EN-GB style='mso-ansi-language:EN-GB'>3.2.</span></a></span><a
name=s14.2></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp; A
Persistent C++ Class<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Let us create a C++ class and store
instances of this class in the </span><tt><span lang=EN-GB style='font-size:
10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>cppdb </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>database. You must first write C++
code for a </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:
"Courier New";mso-ansi-language:EN-GB'>Vehicle </span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'>class. A Vehicle has the following attributes: </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>manufacturer model year </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>and </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:
"Courier New";mso-ansi-language:EN-GB'>retailCost.</span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c14.3"></a><a
href="#top" XXREF="#c14.3"></a><a href="#top" XXREF="#c14.3"></a><a href="#top"
XXREF="#c14.3"></a><a href="#top" XXREF="#c14.3"></a><a href="#top"
XXREF="#c14.3"></a><a href="#top" XXREF="#c14.3"></a><a href="#top"
XXREF="#c14.3"></a><a href="#top" XXREF="#c14.3"></a><a href="#top"
XXREF="#c14.3"></a><a href="#top" XXREF="#c14.3"></a><a href="#top"
XXREF="#c14.3"></a><a href="#top" XXREF="#c14.3"></a><a href="#top"
XXREF="#c14.3"></a><a href="#top" XXREF="#c14.3"></a><a href="#top"
XXREF="#c14.3"></a><a href="#top" XXREF="#c14.3"></a><a href="#top"
XXREF="#c14.3"></a><a href="#top" XXREF="#c14.3"></a><a href="#top"
XXREF="#c14.3"><span lang=EN-GB style='mso-ansi-language:EN-GB'>3.3.</span></a></span><a
name=s14.3></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
The C++ Program<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Next we look at the C++ program
which creates an instance of Vehicle. The C++ Vehicle class derives from
PObject and contains 4 attributes: <o:p></o:p></span></p>

<ul type=disc>
 <ul type=circle>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=DE
      style='mso-ansi-language:DE'>manufacturer which is a </span><tt><span
      lang=DE style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
      DE'>PString</span></tt><span lang=DE style='mso-ansi-language:DE'><o:p></o:p></span></li>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=EN-GB
      style='mso-ansi-language:EN-GB'>model which is also a </span><tt><span
      lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
      EN-GB'>PString</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></li>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=EN-GB
      style='mso-ansi-language:EN-GB'>year which is an </span><tt><span
      lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
      EN-GB'>o_4b</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></li>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=EN-GB
      style='mso-ansi-language:EN-GB'>retailCost which is an </span><tt><span
      lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
      EN-GB'>o_double</span></tt><span lang=EN-GB style='mso-ansi-language:
      EN-GB'><o:p></o:p></span></li>
 </ul>
</ul>

<h3 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c14.3.1"></a><a
href="#top" XXREF="#c14.3.1"></a><a href="#top" XXREF="#c14.3.1"></a><a
href="#top" XXREF="#c14.3.1"></a><a href="#top" XXREF="#c14.3.1"></a><a
href="#top" XXREF="#c14.3.1"></a><a href="#top" XXREF="#c14.3.1"></a><a
href="#top" XXREF="#c14.3.1"></a><a href="#top" XXREF="#c14.3.1"></a><a
href="#top" XXREF="#c14.3.1"></a><a href="#top" XXREF="#c14.3.1"></a><a
href="#top" XXREF="#c14.3.1"></a><a href="#top" XXREF="#c14.3.1"></a><a
href="#top" XXREF="#c14.3.1"></a><a href="#top" XXREF="#c14.3.1"></a><a
href="#top" XXREF="#c14.3.1"></a><a href="#top" XXREF="#c14.3.1"></a><a
href="#top" XXREF="#c14.3.1"></a><a href="#top" XXREF="#c14.3.1"></a><a
href="#top" XXREF="#c14.3.1"><span lang=EN-GB style='mso-ansi-language:EN-GB'>3.3.1.</span></a></span><a
name=s14.3.1></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Vehicle Methods<o:p></o:p></span></h3>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The Vehicle class defines four
methods: <o:p></o:p></span></p>

<ul type=disc>
 <ul type=circle>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=EN-GB
      style='mso-ansi-language:EN-GB'>The Vehicle constructor that takes 4
      arguments and sets each of the attributes.<o:p></o:p></span></li>
 </ul>
</ul>

<pre style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; Vehicle (PString aManufacturer,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PString aModel,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_4b anYear,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_double aRetailCost) {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VPP_CLASS_CONSTRUCTOR1 (Vehicle);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; manufacturer = aManufacturer;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; model = aModel;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; year = anYear;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; retailCost = aRetailCost;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; </span><span
lang=DE style='mso-ansi-language:DE'>}<o:p></o:p></span></pre>

<ul type=disc>
 <ul type=circle>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=DE
      style='mso-ansi-language:DE'>The Vehicle destructor method.<o:p></o:p></span></li>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=EN-GB
      style='mso-ansi-language:EN-GB'>A </span><tt><span lang=EN-GB
      style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>print
      </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>method that
      prints out each of the 4 Vehicle attributes.<o:p></o:p></span></li>
 </ul>
</ul>

<pre style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; void Vehicle::print () {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; printf (&quot;Vehicle:\n\t %14s %s\n\t %14s %s\n\t %14s %d\n\t %14s %.2f\n&quot;,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Manufacturer:&quot;, manufacturer,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Model:&quot;, model,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Year:&quot;, year,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
lang=DE style='mso-ansi-language:DE'>&quot;Retail Cost:&quot;, retailCost);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=DE style='mso-ansi-language:DE'>&nbsp; }<o:p></o:p></span></pre>

<ul type=disc>
 <ul type=circle>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=EN-GB
      style='mso-ansi-language:EN-GB'>A </span><tt><span lang=EN-GB
      style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>findAll
      </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>method that
      returns a </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:
      "Courier New";mso-ansi-language:EN-GB'>LinkVstr </span></tt><span
      lang=EN-GB style='mso-ansi-language:EN-GB'>of all the Vehicle instances
      selected from the database.<o:p></o:p></span></li>
 </ul>
</ul>

<pre style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; LinkVstr&lt;Vehicle&gt; Vehicle::findAll () {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; return PClassObject&lt;Vehicle&gt;::Object().select (NULL,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FALSE,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL_PREDICATE);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; }<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The C++ Vehicle class header and
implementation files, </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>vehicle.h </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>and </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>vehicle.cxx
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>can be found in
your &lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>/sharing/cpp/cppsrc
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>directory. <o:p></o:p></span></p>

<h3 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c14.3.2"></a><a
href="#top" XXREF="#c14.3.2"></a><a href="#top" XXREF="#c14.3.2"></a><a
href="#top" XXREF="#c14.3.2"></a><a href="#top" XXREF="#c14.3.2"></a><a
href="#top" XXREF="#c14.3.2"></a><a href="#top" XXREF="#c14.3.2"></a><a
href="#top" XXREF="#c14.3.2"></a><a href="#top" XXREF="#c14.3.2"></a><a
href="#top" XXREF="#c14.3.2"></a><a href="#top" XXREF="#c14.3.2"></a><a
href="#top" XXREF="#c14.3.2"></a><a href="#top" XXREF="#c14.3.2"></a><a
href="#top" XXREF="#c14.3.2"></a><a href="#top" XXREF="#c14.3.2"></a><a
href="#top" XXREF="#c14.3.2"></a><a href="#top" XXREF="#c14.3.2"></a><a
href="#top" XXREF="#c14.3.2"></a><a href="#top" XXREF="#c14.3.2"></a><a
href="#top" XXREF="#c14.3.2"><span lang=EN-GB style='mso-ansi-language:EN-GB'>3.3.2.</span></a></span><a
name=s14.3.2></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp; Creating
the Schema<o:p></o:p></span></h3>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Recall that in C++, you need to
create an </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>.imp </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>file and run the schema compiler so that you create a </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>.sch </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>schema
file. The </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>.imp </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>file for this example, called </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>example1.imp
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>captures the
schema of the Vehicle class and is provided in the &lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>/sharing/cpp/cppsrc/ </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>directory. To run the schema compiler, you must run the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>schcomp </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>utility
as follows: <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>schcomp -<st1:place w:st="on">I.</st1:place> -Iplatform-dir/h
example1.imp</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>On HP platform you need to use flag -DHP11 for schcomp i.e.</span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>schcomp -DHP11 -<st1:place w:st="on">I.</st1:place>
-Iplatform-dir/h example1.imp</span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'> <br>
&nbsp; <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>where &quot;platform-dir&quot; is
the name of your Versant installation directory. On running the schema
compiler, you will obtain two files: </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>example1.cxx
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>and </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>example1.sch. example1.cxx </span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'>can now be compiled along with</span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'> </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>the
Vehicle header and implementation files, vehicle.h and vehicle.cxx and the main
C++ program. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>To create the schema in the
database, run the schema to database utility as follows: <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>sch2db -d cppdb example1.sch</span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<h3 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c14.3.3"></a><a
href="#top" XXREF="#c14.3.3"></a><a href="#top" XXREF="#c14.3.3"></a><a
href="#top" XXREF="#c14.3.3"></a><a href="#top" XXREF="#c14.3.3"></a><a
href="#top" XXREF="#c14.3.3"></a><a href="#top" XXREF="#c14.3.3"></a><a
href="#top" XXREF="#c14.3.3"></a><a href="#top" XXREF="#c14.3.3"></a><a
href="#top" XXREF="#c14.3.3"></a><a href="#top" XXREF="#c14.3.3"></a><a
href="#top" XXREF="#c14.3.3"></a><a href="#top" XXREF="#c14.3.3"></a><a
href="#top" XXREF="#c14.3.3"></a><a href="#top" XXREF="#c14.3.3"></a><a
href="#top" XXREF="#c14.3.3"></a><a href="#top" XXREF="#c14.3.3"></a><a
href="#top" XXREF="#c14.3.3"></a><a href="#top" XXREF="#c14.3.3"></a><a
href="#top" XXREF="#c14.3.3"><span lang=EN-GB style='mso-ansi-language:EN-GB'>3.3.3.</span></a></span><a
name=s14.3.3></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
The C++ Program<o:p></o:p></span></h3>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The main routine of the C++ program
can be found in the file </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>example1_main.cxx </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>in the </span><span lang=EN-GB
style='font-size:10.0pt;mso-ansi-language:EN-GB'>&lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>/sharing/cpp/cppsrc/ </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>directory. A </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>Makefile </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>is also provided in the
&lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>/sharing/cpp/cppsrc/
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>directory and you can
run&nbsp; </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>make </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>on Unix platforms or <br>
nmake on NT to obtain the </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>example1_main </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>executable. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>When run with a second argument
string of &quot;create&quot;, the example program creates a Vehicle instance in
the database and prints out its attributes. (Otherwise, the example program
does a select on Vehicle instances in the database.) Run the following command
to create a Vehicle instance <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>example1_main cppdb create</span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'> <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The output is as follows: <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>Vehicle:&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Manufacturer: Nissan&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Model: Maxima&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Year: 1998&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
lang=DE style='mso-ansi-language:DE'>Retail Cost: 24886.80<o:p></o:p></span></pre>

<div class=MsoNormal align=center style='margin-left:.5in;text-align:center;
tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'>

<hr size=2 width="100%" align=center>

</span></div>


<h1 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><a
name=s15 XXREF="#c15"></a><a href="#top"><span style='mso-bookmark:s15'></span></a><span
style='mso-bookmark:s15'></span><a href="#top" XXREF="#c15"><span
style='mso-bookmark:s15'></span></a><span style='mso-bookmark:s15'></span><a
href="#top" XXREF="#c15"><span style='mso-bookmark:s15'></span></a><span
style='mso-bookmark:s15'></span><a href="#top" XXREF="#c15"><span
style='mso-bookmark:s15'></span></a><span style='mso-bookmark:s15'></span><a
href="#top" XXREF="#c15"><span style='mso-bookmark:s15'></span></a><span
style='mso-bookmark:s15'></span><a href="#top" XXREF="#c15"><span
style='mso-bookmark:s15'></span></a><span style='mso-bookmark:s15'></span><a
href="#top" XXREF="#c15"><span style='mso-bookmark:s15'></span></a><span
style='mso-bookmark:s15'></span><a href="#top" XXREF="#c15"><span
style='mso-bookmark:s15'></span></a><span style='mso-bookmark:s15'></span><a
href="#top" XXREF="#c15"><span style='mso-bookmark:s15'></span></a><span
style='mso-bookmark:s15'></span><a href="#top" XXREF="#c15"><span
style='mso-bookmark:s15'></span></a><span style='mso-bookmark:s15'></span><a
href="#top" XXREF="#c15"><span style='mso-bookmark:s15'></span></a><span
style='mso-bookmark:s15'></span><a href="#top" XXREF="#c15"><span
style='mso-bookmark:s15'></span></a><span style='mso-bookmark:s15'></span><a
href="#top" XXREF="#c15"><span style='mso-bookmark:s15'></span></a><span
style='mso-bookmark:s15'></span><a href="#top" XXREF="#c15"><span
style='mso-bookmark:s15'></span></a><span style='mso-bookmark:s15'></span><a
href="#top" XXREF="#c15"><span style='mso-bookmark:s15'></span></a><span
style='mso-bookmark:s15'></span><a href="#top" XXREF="#c15"><span
style='mso-bookmark:s15'></span></a><span style='mso-bookmark:s15'></span><a
href="#top" XXREF="#c15"><span style='mso-bookmark:s15'></span></a><span
style='mso-bookmark:s15'></span><a href="#top" XXREF="#c15"><span
style='mso-bookmark:s15'></span></a><span style='mso-bookmark:s15'></span><a
href="#top" XXREF="#c15"><span style='mso-bookmark:s15'></span></a><span
style='mso-bookmark:s15'></span><a href="#top" XXREF="#c15"><span
style='mso-bookmark:s15'><span lang=EN-GB style='mso-ansi-language:EN-GB'>Chapter
4.</span></span><span style='mso-bookmark:s15'></span></a><span
style='mso-bookmark:s15'></span><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;
C++: Sharing The Vehicle Class with JVI<o:p></o:p></span></h1>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c15.1"></a><a
href="#top" XXREF="#c15.1"></a><a href="#top" XXREF="#c15.1"></a><a href="#top"
XXREF="#c15.1"></a><a href="#top" XXREF="#c15.1"></a><a href="#top"
XXREF="#c15.1"></a><a href="#top" XXREF="#c15.1"></a><a href="#top"
XXREF="#c15.1"></a><a href="#top" XXREF="#c15.1"></a><a href="#top"
XXREF="#c15.1"></a><a href="#top" XXREF="#c15.1"></a><a href="#top"
XXREF="#c15.1"></a><a href="#top" XXREF="#c15.1"></a><a href="#top"
XXREF="#c15.1"></a><a href="#top" XXREF="#c15.1"></a><a href="#top"
XXREF="#c15.1"></a><a href="#top" XXREF="#c15.1"></a><a href="#top"
XXREF="#c15.1"></a><a href="#top" XXREF="#c15.1"></a><a href="#top"
XXREF="#c15.1"><span lang=EN-GB style='mso-ansi-language:EN-GB'>4.1.</span></a></span><a
name=s15.1></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Generating the View and Replacement Class<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>We have created the schema for the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>Vehicle </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>class
and created a persistent instance of the class from the C++ language interface.
The tutorial now illustrates how a Transparent JVI program can access instances
of this class and create new ones. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The first stage in developing the
Transparent JVI application is to generate View and Replacement classes for the
schema defined from C++. <o:p></o:p></span></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c15.2"></a><a
href="#top" XXREF="#c15.2"></a><a href="#top" XXREF="#c15.2"></a><a href="#top"
XXREF="#c15.2"></a><a href="#top" XXREF="#c15.2"></a><a href="#top"
XXREF="#c15.2"></a><a href="#top" XXREF="#c15.2"></a><a href="#top"
XXREF="#c15.2"></a><a href="#top" XXREF="#c15.2"></a><a href="#top"
XXREF="#c15.2"></a><a href="#top" XXREF="#c15.2"></a><a href="#top"
XXREF="#c15.2"></a><a href="#top" XXREF="#c15.2"></a><a href="#top"
XXREF="#c15.2"></a><a href="#top" XXREF="#c15.2"></a><a href="#top"
XXREF="#c15.2"></a><a href="#top" XXREF="#c15.2"></a><a href="#top"
XXREF="#c15.2"></a><a href="#top" XXREF="#c15.2"></a><a href="#top"
XXREF="#c15.2"><span lang=EN-GB style='mso-ansi-language:EN-GB'>4.2.</span></a></span><a
name=s15.2></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Using com.versant.Db2Java<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The Java program </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>com.versant.Db2Java </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>generates Java source for C++ defined schema stored in the VERSANT
database. This command accepts several options, and these are itemized in the <i>com.versant.Db2Java
Usage Notes </i>chapter presented later on in this tutorial. <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; -d &lt;dbname&gt;<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The -d option accepts the database
from which the schema is to be read. In this example, the database would be </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>cppdb. </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>You
must always specify a database name so that the tool is aware of which database
to read schema from. <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; -verbose<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The -verbose option prints out
pertinent information while generating the Java View and Replacement class source
code. If you have already generated source code, you need to use the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>-force </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>option
to clobber the already generated files since by default generated code will not
be overwritten. <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; -class &lt;classname1&gt; &lt;classname2&gt; ....<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>You may also specify which files to
generate from the database through using the -class option. Only those foreign
language classes that match the specified names against the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>-class </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>option
will be generated. The matching conforms to <i>Perl5 </i>regular expression
matching syntax for the specified patterns. If you omit this option, all
foreign language classes from the database would be generated, i.e. its
equivalent to specifying a wild card pattern match. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>By default, when classes are
generated according to the names specified against the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>-class </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>option,
their super classes if any are also generated. You can explicitly curb this
behavior through specifying the </span><tt><span lang=EN-GB style='font-size:
10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>-nosuper </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>option. We do not expect that you
would want to do this unless you have changed a sub-class and only want to
regenerate Java code for this class in a second pass of running the program. <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; -o &lt;output path&gt;<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The -o option specifies in which
directory you want the Java files generated. As mentioned, you need to
integrate the generated Java View and Replacement classes with your Transparent
JVI program that uses them. So, you would be eventually compiling and enhancing
these classes. A good place to be generating these Java classes would be in
your enhancer input directory. Following compilation with the rest of your
application, this will allow you to enhance these classes with the rest of your
application classes. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>In the absence of specifying the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>-o &lt;output path&gt; </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>option, Java source code is generated in the same directory from which
the </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>com.versant.Db2Java </span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'>program is run. The source code is generated in
a directory named &quot;jfv&quot; (an abbreviation for &quot;Java Foreign
View&quot;). Each of the generated classes bears the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>jfv. </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>package
name. This allows for clean namespace separation of foreign view classes. <o:p></o:p></span></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c15.3"></a><a
href="#top" XXREF="#c15.3"></a><a href="#top" XXREF="#c15.3"></a><a href="#top"
XXREF="#c15.3"></a><a href="#top" XXREF="#c15.3"></a><a href="#top"
XXREF="#c15.3"></a><a href="#top" XXREF="#c15.3"></a><a href="#top"
XXREF="#c15.3"></a><a href="#top" XXREF="#c15.3"></a><a href="#top"
XXREF="#c15.3"></a><a href="#top" XXREF="#c15.3"></a><a href="#top"
XXREF="#c15.3"></a><a href="#top" XXREF="#c15.3"></a><a href="#top"
XXREF="#c15.3"></a><a href="#top" XXREF="#c15.3"></a><a href="#top"
XXREF="#c15.3"></a><a href="#top" XXREF="#c15.3"></a><a href="#top"
XXREF="#c15.3"></a><a href="#top" XXREF="#c15.3"></a><a href="#top"
XXREF="#c15.3"><span lang=EN-GB style='mso-ansi-language:EN-GB'>4.3.</span></a></span><a
name=s15.3></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Running com.versant.Db2Java on cppdb<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>You are now ready to run the Object
Sharing Java generation program on the C++ database you created and populated
earlier. Let us work in the &lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>/sharing/cpp/in </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>directory. You must first cd to that directory: <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; cd &lt;VERSANT_ROOT&gt;/demo/jvi/advanced/sharing/cpp/in<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Note that there are already files
there named </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:
"Courier New";mso-ansi-language:EN-GB'>Example*.java </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>that contain source code for the
Java application programs we are going to use in this tutorial. We will look
into these later. Recall that running the </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>com.versant.Db2Java
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>program in this
directory will create a new </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>jfv </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>directory with Java source for the
C++ Foreign Language classes stored within. You can now run the Java program as
shown: <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; java com.versant.Db2Java -d cppdb -verbose<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>We use all the default options. So,
we will get all the Foreign Language classes whose schema has been defined in
the </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>cppdb </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>database with verbose information when the program is running. The
standard output that is written when you run the program should be: <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; java com.versant.Db2Java -d cppdb -verbose&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Database: cppdb&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Generating Java Source for: all C++ Classes&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Clobber:&nbsp; OFF&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Output Path: null&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sfj File: jfv\cppdb.sfj&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Generating Java files in: jfv<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>After executing the program, change
directory into the &quot;jfv&quot; directory from the &quot;in&quot; directory.
<o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>cd jfv</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Notice that there are a pair of
files for every C++ class that was stored in the database. If you list the
files in this directory, you should see the following files: <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; PObject.java&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; PObject_Rep.java&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; PVirtual.java&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; PVirtual_Rep.java&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; Vehicle.java&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; Vehicle_Rep.java&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; cppdb.sfj<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Note that there are two pairs of
Java files and one .sfj file. The &quot;.sfj&quot; file is used in an
intermediary stage of the </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>com.versant.Db2Java </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>program when it generates the Java
source code for the foreign language schema. This file allows you to control
the mapping of attribute names in the View class. For now, ignore this file. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>With the C++ language binding, every
persistent class eventually derives from either </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>PObject
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>or </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>PVirtual. </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>The
</span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>Vehicle </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>class derives from </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>PObject. </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Schema for both these classes were
defined in the database on running </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>sch2db
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>and this is
reflected in the pair of Java files generated from the database by the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>com.versant.Db2Java </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>program. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The &quot;_Rep&quot; class is the
Replacement class that we described earlier. The other class is the View class
that you will use in your application. <o:p></o:p></span></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c15.4"></a><a
href="#top" XXREF="#c15.4"></a><a href="#top" XXREF="#c15.4"></a><a href="#top"
XXREF="#c15.4"></a><a href="#top" XXREF="#c15.4"></a><a href="#top"
XXREF="#c15.4"></a><a href="#top" XXREF="#c15.4"></a><a href="#top"
XXREF="#c15.4"></a><a href="#top" XXREF="#c15.4"></a><a href="#top"
XXREF="#c15.4"></a><a href="#top" XXREF="#c15.4"></a><a href="#top"
XXREF="#c15.4"></a><a href="#top" XXREF="#c15.4"></a><a href="#top"
XXREF="#c15.4"></a><a href="#top" XXREF="#c15.4"></a><a href="#top"
XXREF="#c15.4"></a><a href="#top" XXREF="#c15.4"></a><a href="#top"
XXREF="#c15.4"></a><a href="#top" XXREF="#c15.4"></a><a href="#top"
XXREF="#c15.4"><span lang=EN-GB style='mso-ansi-language:EN-GB'>4.4.</span></a></span><a
name=s15.4></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
View Classes for PObject, PVirtual and Vehicle<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Let us now look at the generated
source for these three classes: <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='mso-ansi-language:EN-GB'>PObject.java:</span></b><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; package jfv;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.fund.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.trans.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.util.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import java.util.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; /* JFV View Class for db schema: PObject */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; public class PObject&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; implements com.versant.trans.ViewClass&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; static {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; com.versant.trans.JfvClassMap.java2sch.put (&quot;jfv.PObject&quot;, &quot;PObject&quot;);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; }&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; /* View Class Attributes */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; }<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='mso-ansi-language:EN-GB'>PVirtual.java:</span></b><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; package jfv;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.fund.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.trans.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.util.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import java.util.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; /* JFV View Class for db schema: PVirtual */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; public class PVirtual&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; extends PObject&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; static {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; com.versant.trans.JfvClassMap.java2sch.put (&quot;jfv.PVirtual&quot;, &quot;PVirtual&quot;);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; }&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; /* View Class Attributes */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; }<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Vehicle.java:</span></b><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; package jfv;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.fund.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.trans.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.util.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import java.util.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; /* JFV View Class for db schema: Vehicle */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; public class Vehicle&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; extends PObject&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; static {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; com.versant.trans.JfvClassMap.java2sch.put (&quot;jfv.Vehicle&quot;, &quot;Vehicle&quot;);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; }&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; /* View Class Attributes */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; public java.lang.String manufacturer;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; public java.lang.String model;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; public int year;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; public double retailCost;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; }<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The PObject and PVirtual view
classes have no attributes in them and are super classes from which all C++
view classes derive from. Consider the Vehicle view class. The part of the
generated code you need to be concerned with is the section where the view
class attributes are defined. You must ignore the static initializer block for
the class which is used internally to enable transparent sharing of these
objects. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>Vehicle
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>class contains a </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>String manufacturer String model int year </span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'>and </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>double
retailCost </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>attributes.
Recall that the types for these attributes in C++ were </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>PString, PString, o_4b </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>and </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:
"Courier New";mso-ansi-language:EN-GB'>o_double </span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'>respectively. In the Java View class that you can
utilize in your transparent applications, the attributes are projected as a
Java </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>String, String, int </span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'>and </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>double
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>respectively. For
a complete set of mappings, refer to the chapter <i>C++ Types to View Class
Mapping </i>that follows later on in this tutorial. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The access modifiers for the View
class attributes are &quot;public&quot;. If you want to change it, you can edit
the View class source. <o:p></o:p></span></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c15.5"></a><a
href="#top" XXREF="#c15.5"></a><a href="#top" XXREF="#c15.5"></a><a href="#top"
XXREF="#c15.5"></a><a href="#top" XXREF="#c15.5"></a><a href="#top"
XXREF="#c15.5"></a><a href="#top" XXREF="#c15.5"></a><a href="#top"
XXREF="#c15.5"></a><a href="#top" XXREF="#c15.5"></a><a href="#top"
XXREF="#c15.5"></a><a href="#top" XXREF="#c15.5"></a><a href="#top"
XXREF="#c15.5"></a><a href="#top" XXREF="#c15.5"></a><a href="#top"
XXREF="#c15.5"></a><a href="#top" XXREF="#c15.5"></a><a href="#top"
XXREF="#c15.5"></a><a href="#top" XXREF="#c15.5"></a><a href="#top"
XXREF="#c15.5"></a><a href="#top" XXREF="#c15.5"></a><a href="#top"
XXREF="#c15.5"><span lang=EN-GB style='mso-ansi-language:EN-GB'>4.5.</span></a></span><a
name=s15.5></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Replacement Classes for PObject, PVirtual and Vehicle<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Let us now look at the Java source for
the Replacement classes that were generated. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='mso-ansi-language:EN-GB'>PObject_Rep.java</span></b><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; package jfv;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.fund.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.trans.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.util.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import java.util.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; /* JFV Replacement Class for db schema: PObject */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; public class PObject_Rep&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; implements com.versant.trans.Replacement&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; /* Replacement Class Attributes */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; /* Copy to Replacement Class prior to pickling */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; public void copyPrePickle (java.lang.Object jfvViewObj)&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PObject jfvView = (PObject) jfvViewObj;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; }&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; /* Copy from Replacement Class after unpickling */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; public void copyPostUnpickle (java.lang.Object jfvViewObj)&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PObject jfvView = (PObject) jfvViewObj;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; }&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; }<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='mso-ansi-language:EN-GB'>PVirtual_Rep.java</span></b><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; package jfv;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.fund.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.trans.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.util.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import java.util.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; /* JFV Replacement Class for db schema: PVirtual */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; public class PVirtual_Rep&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; extends PObject_Rep&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; /* Replacement Class Attributes */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; /* Copy to Replacement Class prior to pickling */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; public void copyPrePickle (java.lang.Object jfvViewObj)&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super.copyPrePickle (jfvViewObj);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PVirtual jfvView = (PVirtual) jfvViewObj;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; }&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; /* Copy from Replacement Class after unpickling */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; public void copyPostUnpickle (java.lang.Object jfvViewObj)&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super.copyPostUnpickle (jfvViewObj);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PVirtual jfvView = (PVirtual) jfvViewObj;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; }&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; }<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Vehicle_Rep.java</span></b><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; package jfv;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.fund.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.trans.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import com.versant.util.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; import java.util.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; /* JFV Replacement Class for db schema: Vehicle */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; public class Vehicle_Rep&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; extends PObject_Rep&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; /* Replacement Class Attributes */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; public byte[] Vehicle$S_manufacturer;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; public byte[] Vehicle$S_model;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; public int Vehicle$S_year;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; public double Vehicle$S_retailCost;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; /* Copy to Replacement Class prior to pickling */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; public void copyPrePickle (java.lang.Object jfvViewObj)&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super.copyPrePickle (jfvViewObj);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Vehicle jfvView = (Vehicle) jfvViewObj;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.Vehicle$S_manufacturer =&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JfvUtilities.CPP_getByteArrayFromString (jfvView.manufacturer);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.Vehicle$S_model =&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JfvUtilities.CPP_getByteArrayFromString (jfvView.model);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.Vehicle$S_year = jfvView.year;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.Vehicle$S_retailCost = jfvView.retailCost;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; }&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; /* Copy from Replacement Class after unpickling */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; public void copyPostUnpickle (java.lang.Object jfvViewObj)&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super.copyPostUnpickle (jfvViewObj);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Vehicle jfvView = (Vehicle) jfvViewObj;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jfvView.manufacturer =&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JfvUtilities.CPP_getStringFromByteArray (this.Vehicle$S_manufacturer);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jfvView.model =&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JfvUtilities.CPP_getStringFromByteArray (this.Vehicle$S_model);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jfvView.year = this.Vehicle$S_year;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jfvView.retailCost = this.Vehicle$S_retailCost;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; }&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; }<o:p></o:p></span></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c15.6"></a><a
href="#top" XXREF="#c15.6"></a><a href="#top" XXREF="#c15.6"></a><a href="#top"
XXREF="#c15.6"></a><a href="#top" XXREF="#c15.6"></a><a href="#top"
XXREF="#c15.6"></a><a href="#top" XXREF="#c15.6"></a><a href="#top"
XXREF="#c15.6"></a><a href="#top" XXREF="#c15.6"></a><a href="#top"
XXREF="#c15.6"></a><a href="#top" XXREF="#c15.6"></a><a href="#top"
XXREF="#c15.6"></a><a href="#top" XXREF="#c15.6"></a><a href="#top"
XXREF="#c15.6"></a><a href="#top" XXREF="#c15.6"></a><a href="#top"
XXREF="#c15.6"></a><a href="#top" XXREF="#c15.6"></a><a href="#top"
XXREF="#c15.6"></a><a href="#top" XXREF="#c15.6"></a><a href="#top"
XXREF="#c15.6"><span lang=EN-GB style='mso-ansi-language:EN-GB'>4.6.</span></a></span><a
name=s15.6></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp; Copying
Prior to Pickling and After Unpickling<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The Replacement class transforms
attributes when they are being read from and written to the database so that
the View class always presents the specified attribute names and types to your
application. The </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>PObject </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>and </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>PVirtual
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>Replacement
Classes contain methods that do not perform any transformation of attributes
because we are not concerned with any attributes in these classes. The </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>Vehicle_Rep </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>Java
source code illustrates these transformations. JVI uses the term <b>Pickling </b>to
refer to writing a Java object into the database. <b>Unpickling </b>refers to
the converse, where a persistent Java object has its values read in from the
database. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Every Replacement class will contain
the </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>copyPrePickle </span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'>and </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>copyPostUnpickle
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>methods. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='mso-ansi-language:EN-GB'>copyPrePickle </span></b><span
lang=EN-GB style='mso-ansi-language:EN-GB'>copies an object, attribute by
attribute from the View object into a Replacement object before the Replacement
object is stored (pickled) to the database. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='mso-ansi-language:EN-GB'>copyPostUnpickle </span></b><span
lang=EN-GB style='mso-ansi-language:EN-GB'>copies an object, attribute by
attribute from the Replacement object into the View object when the object is
read (unpickled) from the database. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>In the Vehicle example we consider,
the Replacement class has the same attribute types as the View class for the
year and retailCost. The &quot;transformations&quot; for these attributes are
therefore trivial. </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>copyPrePickle </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>copies attributes directly from the
View to the Replacement instance. </span><tt><span lang=EN-GB style='font-size:
10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>copyPostUnpickle </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>copies attributes directly from the
Replacement to the View instance. However, the manufacturer and model are
presented as Strings in the view class, but are byte arrays in the Replacement
class. Hence, the utility functions: <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>JfvUtilities.CPP_getByteArrayFromString (java.lang.String aString)</span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>and <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>JfvUtilities.CPP_getStringFromByteArray (byte[] byteArray);</span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>are used to transform the attribute
from the View to the Replacement class during pickling and from the Replacement
to the View class during unpickling, respectively. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>For storage transforms and object
sharing involving attribute types in the database that do not have a direct correspondence
to View class attributes, the transformations are not trivial. This is
especially true in the case of using embedded C++ collections in the C++
classes. We will illustrate these transformations through examples later on in
this tutorial. <o:p></o:p></span></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c15.7"></a><a
href="#top" XXREF="#c15.7"></a><a href="#top" XXREF="#c15.7"></a><a href="#top"
XXREF="#c15.7"></a><a href="#top" XXREF="#c15.7"></a><a href="#top"
XXREF="#c15.7"></a><a href="#top" XXREF="#c15.7"></a><a href="#top"
XXREF="#c15.7"></a><a href="#top" XXREF="#c15.7"></a><a href="#top"
XXREF="#c15.7"></a><a href="#top" XXREF="#c15.7"></a><a href="#top"
XXREF="#c15.7"></a><a href="#top" XXREF="#c15.7"></a><a href="#top"
XXREF="#c15.7"></a><a href="#top" XXREF="#c15.7"></a><a href="#top"
XXREF="#c15.7"></a><a href="#top" XXREF="#c15.7"></a><a href="#top"
XXREF="#c15.7"></a><a href="#top" XXREF="#c15.7"></a><a href="#top"
XXREF="#c15.7"><span lang=EN-GB style='mso-ansi-language:EN-GB'>4.7.</span></a></span><a
name=s15.7></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
The Transparent JVI Application<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>You are ready to use the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>Vehicle </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>class
in a Transparent JVI application program. The application has already been
provided to you in the &lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>/sharing/cpp/in </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>directory. The file </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>Example1.java </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>illustrates how a Transparent JVI
program could use the </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>Vehicle </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>class. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>In the example program, we select
all </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>Vehicle </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>instances from the database and increment the Vehicle's retail cost by
$1000.00. This select is done through executing a VQLQuery. Then, we create a
new </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>Vehicle </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>instance and store it in the database. <br>
&nbsp; import com.versant.trans.*; <br>
&nbsp; import com.versant.fund.*; <br>
&nbsp; import java.util.*; <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; public class Example1 { <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; public static
void main (String[] args) <br>
&nbsp;&nbsp;&nbsp; { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (args.length &lt; 1) { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.err.println (&quot;Usage:
java Example1 &lt;dbname&gt;&quot;); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.exit (1); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Properties p = new Properties (); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.setProperty (&quot;database&quot;, args[0]); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.setProperty(&quot;useJFV&quot; ,
&quot;true&quot;); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TransSession s = new TransSession (p); <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
VQLQuery query = new VQLQuery (s, &quot;select selfoid from Vehicle&quot;); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Enumeration e = query.execute (); <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if
(!e.hasMoreElements()) { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println (&quot;No Vehicle
instances were found.&quot;); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while ( e.hasMoreElements() ) { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jfv.Vehicle v =
(jfv.Vehicle) e.nextElement (); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println
(&quot;Found Vehicle instance with\n&quot; + <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot;\tManufacturer: &quot; + v.manufacturer + &quot;\n&quot; + <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot;\tModel: &quot; + v.model + &quot;\n&quot; + <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot;\tYear: &quot; + v.year + &quot;\n&quot; + <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot;\tRetailCost: &quot; + v.retailCost); <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
// increment the Vehicle's retailCost by 1000.00 <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v.retailCost += 1000.00;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //
create a new Vehicle instance and make it persistent <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jfv.Vehicle v = new jfv.Vehicle (); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v.manufacturer = &quot;Audi&quot;; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v.model = &quot;A300&quot;; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v.year = 1998; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v.retailCost = 32650.0; <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s.makePersistent
(v); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s.commit (); <br>
&nbsp;&nbsp;&nbsp; } <br>
&nbsp; } <o:p></o:p></span></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c15.8"></a><a
href="#top" XXREF="#c15.8"></a><a href="#top" XXREF="#c15.8"></a><a href="#top"
XXREF="#c15.8"></a><a href="#top" XXREF="#c15.8"></a><a href="#top"
XXREF="#c15.8"></a><a href="#top" XXREF="#c15.8"></a><a href="#top"
XXREF="#c15.8"></a><a href="#top" XXREF="#c15.8"></a><a href="#top"
XXREF="#c15.8"></a><a href="#top" XXREF="#c15.8"></a><a href="#top"
XXREF="#c15.8"></a><a href="#top" XXREF="#c15.8"></a><a href="#top"
XXREF="#c15.8"></a><a href="#top" XXREF="#c15.8"></a><a href="#top"
XXREF="#c15.8"></a><a href="#top" XXREF="#c15.8"></a><a href="#top"
XXREF="#c15.8"></a><a href="#top" XXREF="#c15.8"></a><a href="#top"
XXREF="#c15.8"><span lang=EN-GB style='mso-ansi-language:EN-GB'>4.8.</span></a></span><a
name=s15.8></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Compiling, Enhancing and Running your Program<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>You are now ready to compile,
enhance and test your application program. First, compile all the .java source
files in the &lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>/sharing/cpp/in/jfv/
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>directory. Then
you should compile the </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>Example1 </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>program that is provided in
&lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>/sharing/cpp/in.
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>If you are using
the </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>javac </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>compiler, you would need to do the following: <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; cd &lt;VERSANT_ROOT&gt;/demo/jvi/advanced/sharing/cpp/in/jfv&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; javac *.java&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; cd ..&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; javac Example1.java<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Now, the compiled Java classes need
to be enhanced. To run the enhancer, you need a configuration file that
specifies the persistence categories for each of the application classes.Our
configuration file , config.vj is present in the
&lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>/sharing/cpp
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>directory and it
looks as follows: <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; c&nbsp; jfv.**&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; a&nbsp; Example*<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The first line specifies that all classes
under the jfv package are persistent capable. This jfv package includes all the
foreign language classes created from C++. Our example program classes that are
run are Persistent Aware. The Example programs access persistent objects but
are themselves not written to the database. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>You can run the enhancer by
specifying: <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; java com.versant.Enhance -out ../out -verbose -config ../config.vj .<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>You are now set to run your
application program. To run </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>Example1 </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>use: <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; cd &lt;VERSANT_ROOT&gt;/demo/jvi/advanced/sharing/cpp/out&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; java Example1 cppdb<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The output of your program should be
as follows: <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>Found Vehicle instance with&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Manufacturer: Nissan&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Model: Maxima&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Year: 1998&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RetailCost: 24886.8<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>You have successfully accessed
objects stored from the C++ language interface from a Transparent JVI program. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>Example1 </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>also
updated the retail cost of the Vehicle instance stored from C++ and created a
new instance and stored it in the database. You can verify that these classes
are stored correctly in the database by running the C++ program </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>example1_main </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>with just a single argument, the database name. Execute: <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>example1_main cppdb</span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'> <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>As mentioned earlier, the C++
program will select all Vehicle instances from the database and print out their
attributes. <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>Found: Vehicle:&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Manufacturer: Nissan&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Model: Maxima&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Year: 1998&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Retail Cost: 25886.80&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>Found: Vehicle:&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Manufacturer: Audi&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Model: A300&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Year: 1998&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Retail Cost: 32650.00<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Notice that the Vehicle instance
that was stored from C++ now has its retail cost updated by $1000.00. Also
notice that you can access the </span><tt><span lang=EN-GB style='font-size:
10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>Vehicle </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>instance created from the
Transparent JVI program in the database from your C++ program. So you have now
successfully accessed objects stored from a Transparent JVI program using the
C++ language interface. <o:p></o:p></span></p>


<div class=MsoNormal align=center style='margin-left:.5in;text-align:center;
tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'>

<hr size=2 width="100%" align=center>

</span></div>


<h1 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><a
name=s16 XXREF="#c16"></a><a href="#top"><span style='mso-bookmark:s16'></span></a><span
style='mso-bookmark:s16'></span><a href="#top" XXREF="#c16"><span
style='mso-bookmark:s16'></span></a><span style='mso-bookmark:s16'></span><a
href="#top" XXREF="#c16"><span style='mso-bookmark:s16'></span></a><span
style='mso-bookmark:s16'></span><a href="#top" XXREF="#c16"><span
style='mso-bookmark:s16'></span></a><span style='mso-bookmark:s16'></span><a
href="#top" XXREF="#c16"><span style='mso-bookmark:s16'></span></a><span
style='mso-bookmark:s16'></span><a href="#top" XXREF="#c16"><span
style='mso-bookmark:s16'></span></a><span style='mso-bookmark:s16'></span><a
href="#top" XXREF="#c16"><span style='mso-bookmark:s16'></span></a><span
style='mso-bookmark:s16'></span><a href="#top" XXREF="#c16"><span
style='mso-bookmark:s16'></span></a><span style='mso-bookmark:s16'></span><a
href="#top" XXREF="#c16"><span style='mso-bookmark:s16'></span></a><span
style='mso-bookmark:s16'></span><a href="#top" XXREF="#c16"><span
style='mso-bookmark:s16'></span></a><span style='mso-bookmark:s16'></span><a
href="#top" XXREF="#c16"><span style='mso-bookmark:s16'></span></a><span
style='mso-bookmark:s16'></span><a href="#top" XXREF="#c16"><span
style='mso-bookmark:s16'></span></a><span style='mso-bookmark:s16'></span><a
href="#top" XXREF="#c16"><span style='mso-bookmark:s16'></span></a><span
style='mso-bookmark:s16'></span><a href="#top" XXREF="#c16"><span
style='mso-bookmark:s16'></span></a><span style='mso-bookmark:s16'></span><a
href="#top" XXREF="#c16"><span style='mso-bookmark:s16'></span></a><span
style='mso-bookmark:s16'></span><a href="#top" XXREF="#c16"><span
style='mso-bookmark:s16'></span></a><span style='mso-bookmark:s16'></span><a
href="#top" XXREF="#c16"><span style='mso-bookmark:s16'></span></a><span
style='mso-bookmark:s16'></span><a href="#top" XXREF="#c16"><span
style='mso-bookmark:s16'></span></a><span style='mso-bookmark:s16'></span><a
href="#top" XXREF="#c16"><span style='mso-bookmark:s16'></span></a><span
style='mso-bookmark:s16'></span><a href="#top" XXREF="#c16"><span
style='mso-bookmark:s16'><span lang=EN-GB style='mso-ansi-language:EN-GB'>Chapter
5.</span></span><span style='mso-bookmark:s16'></span></a><span
style='mso-bookmark:s16'></span><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;
C++: Another Example - The Car Class<o:p></o:p></span></h1>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>In this part of the tutorial, we
will extend the functionality of the </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>Vehicle
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>class created
earlier. In particular you will learn how you can add methods to a shared
foreign language class in Java. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>We will continue to use the database
created earlier. <o:p></o:p></span></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c16.1"></a><a
href="#top" XXREF="#c16.1"></a><a href="#top" XXREF="#c16.1"></a><a href="#top"
XXREF="#c16.1"></a><a href="#top" XXREF="#c16.1"></a><a href="#top"
XXREF="#c16.1"></a><a href="#top" XXREF="#c16.1"></a><a href="#top"
XXREF="#c16.1"></a><a href="#top" XXREF="#c16.1"></a><a href="#top"
XXREF="#c16.1"></a><a href="#top" XXREF="#c16.1"></a><a href="#top"
XXREF="#c16.1"></a><a href="#top" XXREF="#c16.1"></a><a href="#top"
XXREF="#c16.1"></a><a href="#top" XXREF="#c16.1"></a><a href="#top"
XXREF="#c16.1"></a><a href="#top" XXREF="#c16.1"></a><a href="#top"
XXREF="#c16.1"></a><a href="#top" XXREF="#c16.1"></a><a href="#top"
XXREF="#c16.1"><span lang=EN-GB style='mso-ansi-language:EN-GB'>5.1.</span></a></span><a
name=s16.1></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
The C++ Car Class<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The C++ Car class inherits from the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>Vehicle </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>class.
A Car has three additional attributes: <o:p></o:p></span></p>

<ul type=disc>
 <ul type=circle>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=EN-GB
      style='mso-ansi-language:EN-GB'>doors which is an </span><tt><span
      lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
      EN-GB'>o_4b</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></li>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=EN-GB
      style='mso-ansi-language:EN-GB'>cylinders which is also an </span><tt><span
      lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
      EN-GB'>o_4b</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></li>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=EN-GB
      style='mso-ansi-language:EN-GB'>id which is an </span><tt><span
      lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
      EN-GB'>o_u4b</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></li>
 </ul>
</ul>

<h3 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c16.1.1"></a><a
href="#top" XXREF="#c16.1.1"></a><a href="#top" XXREF="#c16.1.1"></a><a
href="#top" XXREF="#c16.1.1"></a><a href="#top" XXREF="#c16.1.1"></a><a
href="#top" XXREF="#c16.1.1"></a><a href="#top" XXREF="#c16.1.1"></a><a
href="#top" XXREF="#c16.1.1"></a><a href="#top" XXREF="#c16.1.1"></a><a
href="#top" XXREF="#c16.1.1"></a><a href="#top" XXREF="#c16.1.1"></a><a
href="#top" XXREF="#c16.1.1"></a><a href="#top" XXREF="#c16.1.1"></a><a
href="#top" XXREF="#c16.1.1"></a><a href="#top" XXREF="#c16.1.1"></a><a
href="#top" XXREF="#c16.1.1"></a><a href="#top" XXREF="#c16.1.1"></a><a
href="#top" XXREF="#c16.1.1"></a><a href="#top" XXREF="#c16.1.1"></a><a
href="#top" XXREF="#c16.1.1"><span lang=EN-GB style='mso-ansi-language:EN-GB'>5.1.1.</span></a></span><a
name=s16.1.1></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Car Methods<o:p></o:p></span></h3>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The Car class defines four methods: <o:p></o:p></span></p>

<ul type=disc>
 <ul type=circle>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=EN-GB
      style='mso-ansi-language:EN-GB'>The Car constructor that takes 7
      arguments and sets each of the attributes.<o:p></o:p></span></li>
 </ul>
</ul>

<pre style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Car (PString aManufacturer,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PString aModel,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_4b anYear,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_double aRetailCost,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_4b numDoors,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_4b numCyl,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_u4b anId) :&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Vehicle (aManufacturer, aModel, anYear, aRetailCost) {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VPP_CLASS_CONSTRUCTOR1 (Car);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doors = numDoors;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
lang=DE style='mso-ansi-language:DE'>cylinders = numCylinders;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=DE style='mso-ansi-language:DE'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id = anId;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=DE style='mso-ansi-language:DE'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></pre>

<ul type=disc>
 <ul type=circle>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=DE
      style='mso-ansi-language:DE'>The Car destructor method.<o:p></o:p></span></li>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=EN-GB
      style='mso-ansi-language:EN-GB'>A </span><tt><span lang=EN-GB
      style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>print
      </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>method that prints
      out all the 7 Car (and inherited Vehicle) attributes.<o:p></o:p></span></li>
 </ul>
</ul>

<pre style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; void Car::print () {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; printf (&quot;Car:\n\t %14s %s\n\t %14s %s\n\t %14s %d\n\t %14s %.2f %14s %d\n\t %14s %d\n\t %14s %d\n&quot;,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Manufacturer:&quot;, manufacturer,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Model:&quot;, model,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Year:&quot;, year,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Retail Cost:&quot;, retailCost,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Doors:&quot;, doors,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
lang=DE style='mso-ansi-language:DE'>&quot;Cylinders:&quot;, cylinders,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=DE style='mso-ansi-language:DE'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Id:&quot;, id);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=DE style='mso-ansi-language:DE'>&nbsp; }<o:p></o:p></span></pre>

<ul type=disc>
 <ul type=circle>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=EN-GB
      style='mso-ansi-language:EN-GB'>A </span><tt><span lang=EN-GB
      style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>findAll
      </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>method that
      returns a </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:
      "Courier New";mso-ansi-language:EN-GB'>LinkVstr </span></tt><span
      lang=EN-GB style='mso-ansi-language:EN-GB'>of all the Car instances
      selected from the database.<o:p></o:p></span></li>
 </ul>
</ul>

<pre style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; LinkVstr&lt;Car&gt; Car::findAll () {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; return PClassObject&lt;Car&gt;::Object().select (NULL,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FALSE,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL_PREDICATE);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; }<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The C++ Car class header and implementation
files, </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>car.h </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>and </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:
"Courier New";mso-ansi-language:EN-GB'>car.cxx </span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'>can be found in your </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>VI/tutorial/sharing/cpp/cppsrc </span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'>directory. <o:p></o:p></span></p>

<h3 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c16.1.2"></a><a
href="#top" XXREF="#c16.1.2"></a><a href="#top" XXREF="#c16.1.2"></a><a
href="#top" XXREF="#c16.1.2"></a><a href="#top" XXREF="#c16.1.2"></a><a
href="#top" XXREF="#c16.1.2"></a><a href="#top" XXREF="#c16.1.2"></a><a
href="#top" XXREF="#c16.1.2"></a><a href="#top" XXREF="#c16.1.2"></a><a
href="#top" XXREF="#c16.1.2"></a><a href="#top" XXREF="#c16.1.2"></a><a
href="#top" XXREF="#c16.1.2"></a><a href="#top" XXREF="#c16.1.2"></a><a
href="#top" XXREF="#c16.1.2"></a><a href="#top" XXREF="#c16.1.2"></a><a
href="#top" XXREF="#c16.1.2"></a><a href="#top" XXREF="#c16.1.2"></a><a
href="#top" XXREF="#c16.1.2"></a><a href="#top" XXREF="#c16.1.2"></a><a
href="#top" XXREF="#c16.1.2"><span lang=EN-GB style='mso-ansi-language:EN-GB'>5.1.2.</span></a></span><a
name=s16.1.2></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Creating the Schema<o:p></o:p></span></h3>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Recall that in C++, you need to
create an </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>.imp </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>file and run the schema compiler so that you create a </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>.sch </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>schema
file. The </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>.imp </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>file for this example, called </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>example2.imp
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>captures the
schema of the Car class and is provided in the
&lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>/sharing/cpp/cppsrc/
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>directory. To run
the schema compiler, you must run the </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>schcomp
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>utility as
follows: <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>schcomp -<st1:place w:st="on">I.</st1:place> -Iplatform-dir/h
example2.imp</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>On HP platform you need to use flag -DHP11 for schcomp i.e.</span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <br>
</span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>schcomp -DHP11 -<st1:place w:st="on">I.</st1:place>
-Iplatform-dir/h example2.imp</span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'> <br>
&nbsp; <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>where &quot;platform-dir&quot; is
the name of your Versant installation directory. On running the schema compiler,
you will obtain two files: </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>example2.cxx </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>and </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>example2.sch.
example2.cxx can now be compiled along with </span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'>the Car header and implementation files, car.h
and car.cxx, the Vehicle files vehicle.h and vehicle.cxx and the main C++
program. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>To create the schema in the
database, run the schema to database utility as follows: <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>sch2db -d cppdb example2.sch</span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<h3 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c16.1.3"></a><a
href="#top" XXREF="#c16.1.3"></a><a href="#top" XXREF="#c16.1.3"></a><a
href="#top" XXREF="#c16.1.3"></a><a href="#top" XXREF="#c16.1.3"></a><a
href="#top" XXREF="#c16.1.3"></a><a href="#top" XXREF="#c16.1.3"></a><a
href="#top" XXREF="#c16.1.3"></a><a href="#top" XXREF="#c16.1.3"></a><a
href="#top" XXREF="#c16.1.3"></a><a href="#top" XXREF="#c16.1.3"></a><a
href="#top" XXREF="#c16.1.3"></a><a href="#top" XXREF="#c16.1.3"></a><a
href="#top" XXREF="#c16.1.3"></a><a href="#top" XXREF="#c16.1.3"></a><a
href="#top" XXREF="#c16.1.3"></a><a href="#top" XXREF="#c16.1.3"></a><a
href="#top" XXREF="#c16.1.3"></a><a href="#top" XXREF="#c16.1.3"></a><a
href="#top" XXREF="#c16.1.3"><span lang=EN-GB style='mso-ansi-language:EN-GB'>5.1.3.</span></a></span><a
name=s16.1.3></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
The C++ Program<o:p></o:p></span></h3>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The main routine of the C++ program
can be found in the file </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>example2_main.cxx </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>in the
&lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>/sharing/cpp/cppsrc
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>directory. A </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>Makefile </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>is
also provided in the &lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>/sharing/cpp/cppsrc </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>directory and you can run </span><tt><span lang=EN-GB style='font-size:
10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>make </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>on Unix platforms or </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>nmake </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>on
NT&nbsp; to obtain the </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>example2_main </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>executable. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>When run with a second argument string
of &quot;create&quot;, the example program creates a Car instance in the
database and prints out its attributes. (Otherwise, the example program does a
select on Car instances in the database.) Run the following command to create a
Car instance <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>example2_main cppdb create</span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'> <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The output is as follows: <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>Car:&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Manufacturer: Volvo&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Model: 860&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Year: 1996&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Retail Cost: 27660.00&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Doors: 4&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cylinders: 6&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Id: 187828<o:p></o:p></span></pre>

<div class=MsoNormal align=center style='margin-left:.5in;text-align:center;
tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'>

<hr size=2 width="100%" align=center>

</span></div>


<h1 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><a
name=s17 XXREF="#c17"></a><a href="#top"><span style='mso-bookmark:s17'></span></a><span
style='mso-bookmark:s17'></span><a href="#top" XXREF="#c17"><span
style='mso-bookmark:s17'></span></a><span style='mso-bookmark:s17'></span><a
href="#top" XXREF="#c17"><span style='mso-bookmark:s17'></span></a><span
style='mso-bookmark:s17'></span><a href="#top" XXREF="#c17"><span
style='mso-bookmark:s17'></span></a><span style='mso-bookmark:s17'></span><a
href="#top" XXREF="#c17"><span style='mso-bookmark:s17'></span></a><span
style='mso-bookmark:s17'></span><a href="#top" XXREF="#c17"><span
style='mso-bookmark:s17'></span></a><span style='mso-bookmark:s17'></span><a
href="#top" XXREF="#c17"><span style='mso-bookmark:s17'></span></a><span
style='mso-bookmark:s17'></span><a href="#top" XXREF="#c17"><span
style='mso-bookmark:s17'></span></a><span style='mso-bookmark:s17'></span><a
href="#top" XXREF="#c17"><span style='mso-bookmark:s17'></span></a><span
style='mso-bookmark:s17'></span><a href="#top" XXREF="#c17"><span
style='mso-bookmark:s17'></span></a><span style='mso-bookmark:s17'></span><a
href="#top" XXREF="#c17"><span style='mso-bookmark:s17'></span></a><span
style='mso-bookmark:s17'></span><a href="#top" XXREF="#c17"><span
style='mso-bookmark:s17'></span></a><span style='mso-bookmark:s17'></span><a
href="#top" XXREF="#c17"><span style='mso-bookmark:s17'></span></a><span
style='mso-bookmark:s17'></span><a href="#top" XXREF="#c17"><span
style='mso-bookmark:s17'></span></a><span style='mso-bookmark:s17'></span><a
href="#top" XXREF="#c17"><span style='mso-bookmark:s17'></span></a><span
style='mso-bookmark:s17'></span><a href="#top" XXREF="#c17"><span
style='mso-bookmark:s17'></span></a><span style='mso-bookmark:s17'></span><a
href="#top" XXREF="#c17"><span style='mso-bookmark:s17'></span></a><span
style='mso-bookmark:s17'></span><a href="#top" XXREF="#c17"><span
style='mso-bookmark:s17'></span></a><span style='mso-bookmark:s17'></span><a
href="#top" XXREF="#c17"><span style='mso-bookmark:s17'></span></a><span
style='mso-bookmark:s17'></span><a href="#top" XXREF="#c17"><span
style='mso-bookmark:s17'><span lang=EN-GB style='mso-ansi-language:EN-GB'>Chapter
6.</span></span><span style='mso-bookmark:s17'></span></a><span
style='mso-bookmark:s17'></span><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;
C++: Sharing The Car Class with JVI<o:p></o:p></span></h1>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c17.1"></a><a
href="#top" XXREF="#c17.1"></a><a href="#top" XXREF="#c17.1"></a><a href="#top"
XXREF="#c17.1"></a><a href="#top" XXREF="#c17.1"></a><a href="#top"
XXREF="#c17.1"></a><a href="#top" XXREF="#c17.1"></a><a href="#top"
XXREF="#c17.1"></a><a href="#top" XXREF="#c17.1"></a><a href="#top"
XXREF="#c17.1"></a><a href="#top" XXREF="#c17.1"></a><a href="#top"
XXREF="#c17.1"></a><a href="#top" XXREF="#c17.1"></a><a href="#top"
XXREF="#c17.1"></a><a href="#top" XXREF="#c17.1"></a><a href="#top"
XXREF="#c17.1"></a><a href="#top" XXREF="#c17.1"></a><a href="#top"
XXREF="#c17.1"></a><a href="#top" XXREF="#c17.1"></a><a href="#top"
XXREF="#c17.1"><span lang=EN-GB style='mso-ansi-language:EN-GB'>6.1.</span></a></span><a
name=s17.1></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Generating the View and Replacement Class<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>We have created the schema for the
Car class and created a persistent instance of the class from the C++ language
interface. The tutorial now illustrates how a Transparent JVI program can
access instances of this class and create new ones. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The first stage in developing the
Transparent JVI application is to generate View and Replacement classes for the
schema defined from C++. <o:p></o:p></span></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c17.2"></a><a
href="#top" XXREF="#c17.2"></a><a href="#top" XXREF="#c17.2"></a><a href="#top"
XXREF="#c17.2"></a><a href="#top" XXREF="#c17.2"></a><a href="#top"
XXREF="#c17.2"></a><a href="#top" XXREF="#c17.2"></a><a href="#top"
XXREF="#c17.2"></a><a href="#top" XXREF="#c17.2"></a><a href="#top"
XXREF="#c17.2"></a><a href="#top" XXREF="#c17.2"></a><a href="#top"
XXREF="#c17.2"></a><a href="#top" XXREF="#c17.2"></a><a href="#top"
XXREF="#c17.2"></a><a href="#top" XXREF="#c17.2"></a><a href="#top"
XXREF="#c17.2"></a><a href="#top" XXREF="#c17.2"></a><a href="#top"
XXREF="#c17.2"></a><a href="#top" XXREF="#c17.2"></a><a href="#top"
XXREF="#c17.2"><span lang=EN-GB style='mso-ansi-language:EN-GB'>6.2.</span></a></span><a
name=s17.2></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Running com.versant.Db2Java on cppdb<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>You are now ready to run the Object
Sharing Java generation program on the C++ database that you have created and
populated. We are working in the &lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'> /sharing/cpp/in </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>directory. You must first cd to that directory: <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; cd &lt;VERSANT_ROOT&gt;/demo/jvi/advanced/sharing/cpp/in<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Recall that running the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>com.versant.Db2Java </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>program in this directory will create a new </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>jfv </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>directory with Java source for the
C++ Foreign Language classes stored within. You can now run the Java program as
shown: <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; java com.versant.Db2Java -d cppdb -class Car -verbose<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>We use the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>-class Car </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>option
since we know that Car was the only C++ class added since the previous run of
the </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>com.versant.Db2Java </span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'>tool. Alternately, you can also use the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>-force </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>option
and avoid specifying the class name. This will result in .java source files for
all the C++ classes in the database being regenerated. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>After executing the program, change
directory into the &quot;jfv&quot; directory from the &quot;in&quot; directory.
<o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>cd jfv</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>If you list the files in this
directory, you should see the following files: <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; PObject.java&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; PObject_Rep.java&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; PVirtual.java&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; PVirtual_Rep.java&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; Vehicle.java&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; Vehicle_Rep.java&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; Car.java&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; Car_Rep.java&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; cppdb.sfj<o:p></o:p></span></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c17.3"></a><a
href="#top" XXREF="#c17.3"></a><a href="#top" XXREF="#c17.3"></a><a href="#top"
XXREF="#c17.3"></a><a href="#top" XXREF="#c17.3"></a><a href="#top"
XXREF="#c17.3"></a><a href="#top" XXREF="#c17.3"></a><a href="#top"
XXREF="#c17.3"></a><a href="#top" XXREF="#c17.3"></a><a href="#top"
XXREF="#c17.3"></a><a href="#top" XXREF="#c17.3"></a><a href="#top"
XXREF="#c17.3"></a><a href="#top" XXREF="#c17.3"></a><a href="#top"
XXREF="#c17.3"></a><a href="#top" XXREF="#c17.3"></a><a href="#top"
XXREF="#c17.3"></a><a href="#top" XXREF="#c17.3"></a><a href="#top"
XXREF="#c17.3"></a><a href="#top" XXREF="#c17.3"></a><a href="#top"
XXREF="#c17.3"><span lang=EN-GB style='mso-ansi-language:EN-GB'>6.3.</span></a></span><a
name=s17.3></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
View Class for Car<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Let us now look at the generated
source for the Car class. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Car.java:</span></b><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>package jfv;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>import com.versant.fund.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>import com.versant.trans.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>import com.versant.util.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>import java.util.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>/* JFV View Class for db schema: Car */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>public class Car&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>extends Vehicle&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>{&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; static {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; com.versant.trans.JfvClassMap.java2sch.put (&quot;jfv.Car&quot;, &quot;Car&quot;);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; }&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; /* View Class Attributes */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; public int doors;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; public int cylinders;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; public long id;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>}<o:p></o:p></span></pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The Car View class contains </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>int doors, int cylinders, </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>and </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:
"Courier New";mso-ansi-language:EN-GB'>long id </span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'>attributes. Recall that we defined the
attributes to be of types </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>o_4b o_4b </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>and </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>o_u4b
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>respectively in
the C++ class. This resulted in the attributes being stored to the VERSANT
database as </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:
"Courier New";mso-ansi-language:EN-GB'>o_4b, o_4b, </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>and </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>o_u4b
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>Hence, in the Java
View class that you can utilize in your transparent applications, the
attributes are projected as a Java </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>int,
int, </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>and </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>long </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>respectively.
For a complete set of mappings, refer to the chapter <i>C++ Types to View Class
Mapping </i>that follows later on in this tutorial. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The access modifiers for these View
class attributes are &quot;public&quot;. If you want to change it, you can edit
the View class source. <o:p></o:p></span></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c17.4"></a><a
href="#top" XXREF="#c17.4"></a><a href="#top" XXREF="#c17.4"></a><a href="#top"
XXREF="#c17.4"></a><a href="#top" XXREF="#c17.4"></a><a href="#top"
XXREF="#c17.4"></a><a href="#top" XXREF="#c17.4"></a><a href="#top"
XXREF="#c17.4"></a><a href="#top" XXREF="#c17.4"></a><a href="#top"
XXREF="#c17.4"></a><a href="#top" XXREF="#c17.4"></a><a href="#top"
XXREF="#c17.4"></a><a href="#top" XXREF="#c17.4"></a><a href="#top"
XXREF="#c17.4"></a><a href="#top" XXREF="#c17.4"></a><a href="#top"
XXREF="#c17.4"></a><a href="#top" XXREF="#c17.4"></a><a href="#top"
XXREF="#c17.4"></a><a href="#top" XXREF="#c17.4"></a><a href="#top"
XXREF="#c17.4"><span lang=EN-GB style='mso-ansi-language:EN-GB'>6.4.</span></a></span><a
name=s17.4></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Replacement Class for Car<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Let us now look at the Java source
for the Replacement Car class. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Car_Rep.java</span></b><span
lang=EN-GB style='mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<pre style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>package jfv;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>import com.versant.fund.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>import com.versant.trans.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>import com.versant.util.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>import java.util.*;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>/* JFV Replacement Class for db schema: Car */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>public class Car_Rep&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>extends Vehicle_Rep&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>{&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; /* Replacement Class Attributes */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; public int Car$S_doors;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; public int Car$S_cylinders;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; public int Car$S_id;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; /* Copy to Replacement Class prior to pickling */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; public void copyPrePickle (java.lang.Object jfvViewObj)&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; super.copyPrePickle (jfvViewObj);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; Car jfvView = (Car) jfvViewObj;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; this.Car$S_doors = jfvView.doors;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; this.Car$S_cylinders = jfvView.cylinders;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; this.Car$S_id = JfvUtilities.CPP_getIntFromLong (jfvView.id);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; }&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; /* Copy from Replacement Class after unpickling */&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; public void copyPostUnpickle (java.lang.Object jfvViewObj)&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; super.copyPostUnpickle (jfvViewObj);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; Car jfvView = (Car) jfvViewObj;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; jfvView.doors = this.Car$S_doors;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; jfvView.cylinders = this.Car$S_cylinders;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; jfvView.id = JfvUtilities.CPP_getLongFromInt (this.Car$S_id);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp; }&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in'><span lang=EN-GB style='mso-ansi-language:EN-GB'>}<o:p></o:p></span></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c17.5"></a><a
href="#top" XXREF="#c17.5"></a><a href="#top" XXREF="#c17.5"></a><a href="#top"
XXREF="#c17.5"></a><a href="#top" XXREF="#c17.5"></a><a href="#top"
XXREF="#c17.5"></a><a href="#top" XXREF="#c17.5"></a><a href="#top"
XXREF="#c17.5"></a><a href="#top" XXREF="#c17.5"></a><a href="#top"
XXREF="#c17.5"></a><a href="#top" XXREF="#c17.5"></a><a href="#top"
XXREF="#c17.5"></a><a href="#top" XXREF="#c17.5"></a><a href="#top"
XXREF="#c17.5"></a><a href="#top" XXREF="#c17.5"></a><a href="#top"
XXREF="#c17.5"></a><a href="#top" XXREF="#c17.5"></a><a href="#top"
XXREF="#c17.5"></a><a href="#top" XXREF="#c17.5"></a><a href="#top"
XXREF="#c17.5"><span lang=EN-GB style='mso-ansi-language:EN-GB'>6.5.</span></a></span><a
name=s17.5></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Copying Prior to Pickling and After Unpickling<o:p></o:p></span></h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>Car_Rep
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>Java source code
contains the </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:
"Courier New";mso-ansi-language:EN-GB'>copyPrePickle </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>and </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>copyPostUnpickle
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>methods that
illustrate transformations between the View class attributes and the
Replacement class attributes. Recall that </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>copyPrePickle
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>copies an object,
attribute by attribute from the View instance into a Replacement instance
before the object is stored (pickled) to the database. </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>copyPostUnpickle </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>copies an object, attribute by attribute from the Replacement instance
into a View instance when the object is read (unpickled) from the database. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>In the Car class, the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>doors </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>and </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>cylinders </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>attributes
have the same type in the Replacement and View class. As in the case of </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>Vehicle </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>the
&quot;transformations&quot; are therefore trivial. However, the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>o_u4b </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>attribute
which is a long in the view class goes through a transformation. The </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>id </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>attribute
in Car is stored in the database as an unsigned 4 byte value. </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>int </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>in Java
is 4 bytes, which means we need a larger sized type to store the id. The
nearest larger type is </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>long. </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The database type </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>o_u4b </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>hence
maps to the type </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>long </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>in the transparent Java language
binding of the View class. Since the range of Java </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>long
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>is larger than
that of </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>o_u4b </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>which is the type in the database, there could be a loss of information
when storing a value from Java. You need to be aware of this when you write
your object sharing programs with JVI. <o:p></o:p></span></p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The transformations for the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>id </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>attribute
are therefore as follows: <o:p></o:p></span></p>

<ul type=disc>
 <ul type=circle>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=EN-GB
      style='mso-ansi-language:EN-GB'>When copying from the View class (where
      the attribute is a </span><tt><span lang=EN-GB style='font-size:10.0pt;
      font-family:"Courier New";mso-ansi-language:EN-GB'>long) </span></tt><span
      lang=EN-GB style='mso-ansi-language:EN-GB'>to the Replacement class
      (where the attribute is an unsigned integer, </span><tt><span lang=EN-GB
      style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>int)
      </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>we call the
      utility method </span><tt><span lang=EN-GB style='font-size:10.0pt;
      font-family:"Courier New";mso-ansi-language:EN-GB'>JfvUtilities.CPP_getIntFromLong.</span></tt><span
      lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></li>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l1 level2 lfo12;tab-stops:list 1.0in'><span lang=EN-GB
      style='mso-ansi-language:EN-GB'>When copying from the Replacement class
      (where the attribute is an unsigned integer </span><tt><span lang=EN-GB
      style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>int)
      </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>to the View
      class (where the attribute is a </span><tt><span lang=EN-GB
      style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>long)
      </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>we call the
      utility method </span><tt><span lang=EN-GB style='font-size:10.0pt;
      font-family:"Courier New";mso-ansi-language:EN-GB'>JfvUtilities.CPP_getLongFromInt.</span></tt><span
      lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></li>
 </ul>
</ul>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>JfvUtilities </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>is
a class in the </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:
"Courier New";mso-ansi-language:EN-GB'>com.versant.utils </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>package which contains a large
number of transformation functions named according to the transformation being
performed. <o:p></o:p></span></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><a
href="D:vod7012jvitutorialsharing%22%20l%20" \t
\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \t&nbsp; Retail
\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \t&nbsp;&nbsp;&nbsp;
\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Usage: java
dbname></a><a href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.6&quot;"></a><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c17.6&quot;"><span
lang=EN-GB style='mso-ansi-language:EN-GB'>6.6.</span></a></span><span
lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;</span> Adding Methods
to Car</h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'>You
are now going to add two methods to the Car view class. We mentioned that a
View class must be treated similar to any other persistent Java class in an
application. We add two methods for the Car class in <tt><span
style='font-size:10.0pt;font-family:"Courier New"'>Car.java </span></tt>accessing
the attributes of the class in the usual way. </p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'>Let
us create a constructor for the Car class that initializes all of its
attributes. Let us also create a <tt><span style='font-size:10.0pt;font-family:
"Courier New"'>toString () </span></tt>method that returns a <tt><span
style='font-size:10.0pt;font-family:"Courier New"'>String </span></tt>of the
Car attributes. </p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'>These
method are quite simple and are shown below: </p>

<pre style='margin-left:.5in'>&nbsp;</pre><pre style='margin-left:.5in'>&nbsp; /* Added on after generation */&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp; public Car (String aManufacturer,&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String aModel,&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int anYear,&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double aRetailCost,&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int numDoors,&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int numCylinders,&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long anId) {&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp; manufacturer = aManufacturer;&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp; model = aModel;&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp; year = anYear;&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp; retailCost = aRetailCost;&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp; doors = numDoors;&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp; cylinders = numCylinders;&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp; id = anId;&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp; }&nbsp;</pre><pre style='margin-left:.5in'>&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp; /* Added on after generation */&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp; public String toString () {&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp; return new String (&quot;Car:\n&quot; + &quot;\t Manufacturer: &quot; + manufacturer + &quot;\n&quot; +&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Model: &quot; + model + &quot;\n&quot; +&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Year: &quot; + year + &quot;\n&quot; +&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;\t&nbsp; Retail Cost: &quot; + retailCost + &quot;\n&quot; +&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Doors: &quot; + doors + &quot;\n&quot; +&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;\t&nbsp;&nbsp;&nbsp; Cylinders: &quot; + cylinders + &quot;\n&quot; +&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Id: &quot; + id);&nbsp;</pre><pre
style='margin-left:.5in'>&nbsp; }</pre>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'>After
adding the above methods to <tt><span style='font-size:10.0pt;font-family:"Courier New"'>Car.java
</span></tt>you are ready to compile and enhance the Java files. Before that we
need to look at the Transparent JVI Application that uses the Car class. <o:p></o:p></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><a
href="D:vod7012jvitutorialsharing%22%20l%20" XXREF="#c17.7"></a><span lang=DE
style='mso-ansi-language:DE'><a href="#top" XXREF="#c17.7"><span lang=EN-GB
style='mso-ansi-language:EN-GB'>6.7.</span></a></span>&nbsp;&nbsp; The
Transparent JVI Application</h2>

<p class=MsoNormal style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'>You
are ready to use the Car class in a Transparent JVI application program. The
application has already been provided to you in the <tt><span style='font-size:
10.0pt;font-family:"Courier New"'>JVI/tutorial/sharing/cpp/in </span></tt>directory.
The file <tt><span style='font-size:10.0pt;font-family:"Courier New"'>Example2.java
</span></tt>illustrates how a Transparent JVI program could use the Car class. </p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'>In
the example program, we select all Car instances from the database and
increment the Car's retail cost by $1000.00. The select is done through
executing a VQLQuery. Then, we create a new Car instance and store it in the
database. <br>
import jfv.*; <br>
import com.versant.trans.*; <br>
import com.versant.fund.*; <br>
import com.versant.util.*; <br>
import java.util.*; <br>
&nbsp; </p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'>public
class Example2 <br>
{ <br>
&nbsp; public static void main (String[] args) { <br>
&nbsp;&nbsp;&nbsp; if (args.length &lt; 1) { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.err.println (&quot;Usage: java Example2
&lt;dbname&gt;&quot;); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.exit (1); <br>
&nbsp;&nbsp;&nbsp; } </p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'>&nbsp;&nbsp;&nbsp;
Properties p = new Properties (); <br>
&nbsp;&nbsp;&nbsp; p.setProperty (&quot;database&quot;, args[0]); <br>
&nbsp;&nbsp;&nbsp; p.setProperty(&quot;useJFV&quot; , &quot;true&quot;); <br>
&nbsp;&nbsp;&nbsp; TransSession s = new TransSession (p); </p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'>&nbsp;&nbsp;&nbsp;
VQLQuery query = new VQLQuery (s, &quot;select selfoid from Car&quot;); <br>
&nbsp;&nbsp;&nbsp; Enumeration e = query.execute (); </p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'>&nbsp;&nbsp;&nbsp;
if (!e.hasMoreElements()) { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println (&quot;No Car instances were
found.&quot;); <br>
&nbsp;&nbsp;&nbsp; } </p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'>&nbsp;&nbsp;&nbsp;
else { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while ( e.hasMoreElements() ) { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jfv.Car c = (jfv.Car) e.nextElement
(); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println (&quot;Found Car
instance: &quot; + c); </p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
// increment the Car's retailCost by 1000.00 <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c.retailCost += 1000.00; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>
&nbsp;&nbsp;&nbsp; } </p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'>&nbsp;&nbsp;&nbsp;
// create a new Car instance and make it persistent <br>
&nbsp;&nbsp;&nbsp; jfv.Car c = new jfv.Car (&quot;Honda&quot;,
&quot;Civic&quot;, 1997, 16770.50, 2, 4, 837365); </p>

<p style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'>&nbsp;&nbsp;&nbsp;
s.makePersistent (c); <br>
&nbsp;&nbsp;&nbsp; s.commit (); <br>
&nbsp; } <br>
} </p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><a
name=s17.6></a><span lang=DE style='mso-ansi-language:DE'><a href="#top"></a><a
href="#top" XXREF="#c17.8"></a><a href="#top" XXREF="#c17.8"></a><a href="#top"
XXREF="#c17.8"></a><a href="#top" XXREF="#c17.8"></a><a href="#top"
XXREF="#c17.8"></a><a href="#top" XXREF="#c17.8"></a><a href="#top"
XXREF="#c17.8"></a><a href="#top" XXREF="#c17.8"></a><a href="#top"
XXREF="#c17.8"></a><a href="#top" XXREF="#c17.8"></a><a href="#top"
XXREF="#c17.8"></a><a href="#top" XXREF="#c17.8"></a><a href="#top"
XXREF="#c17.8"></a><a href="#top" XXREF="#c17.8"></a><a href="#top"
XXREF="#c17.8"></a><a href="#top" XXREF="#c17.8"></a><a href="#top"
XXREF="#c17.8"></a><a href="#top" XXREF="#c17.8"></a><a href="#top"
XXREF="#c17.8"><span lang=EN-GB style='mso-ansi-language:EN-GB'>6.8.</span></a></span><a
name=s17.8></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp; Compiling,
Enhancing and Running your Program<o:p></o:p></span></h2>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>You are now ready to compile, enhance and test your
application program. First, compile all the .java source files in the </span><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>&lt;VERSANT_ROOT&gt;/demo/jvi/advanced<tt><span
style='mso-ansi-font-size:12.0pt;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman"'>/sharing/cpp/in/jfv/
</span></tt></span><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
18.0pt;mso-ansi-language:EN-GB;font-weight:normal'>directory. Then you should
compile the </span><tt><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
10.0pt;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman";
mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB;font-weight:
normal'>Example2 </span></tt><span lang=EN-GB style='font-size:12.0pt;
mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB;font-weight:normal'>program
that is provided in </span><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
10.0pt;mso-ansi-language:EN-GB;font-weight:normal'>&lt;VERSANT_ROOT&gt;/demo/jvi/advanced<tt><span
style='mso-ansi-font-size:12.0pt;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman"'>/sharing/cpp/in.
</span></tt></span><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
18.0pt;mso-ansi-language:EN-GB;font-weight:normal'>If you are using the </span><tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-GB;font-weight:normal'>javac </span></tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>compiler, you would need to do the following: <o:p></o:p></span></h2>

<pre style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>&nbsp; cd &lt;VERSANT_ROOT&gt;/demo/jvi/advanced/sharing/cpp/in/jfv&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp; javac *.java&nbsp;<o:p></o:p></span></pre><pre style='margin-left:
.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
10.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp; cd ..&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp; javac Example2.java<o:p></o:p></span></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>Now, the compiled Java classes need to be enhanced.
To run the enhancer, you need a configuration file that specifies the
persistence categories for each of the application classes. <o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB'>Our
configuration file present in the </span><span lang=EN-GB style='mso-bidi-font-size:
10.0pt;mso-ansi-language:EN-GB'>&lt;VERSANT_ROOT&gt;/demo/jvi/advanced<tt><span
style='mso-ansi-font-size:12.0pt;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman"'>/sharing/cpp
</span></tt></span><span lang=EN-GB style='mso-bidi-font-size:18.0pt;
mso-ansi-language:EN-GB'>directory is called </span><tt><span lang=EN-GB
style='mso-ansi-font-size:12.0pt;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman";
mso-ansi-language:EN-GB'>config.vj. </span></tt><span lang=EN-GB
style='mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB'>This file looks as
follows: <o:p></o:p></span></p>

<pre style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>&nbsp; c&nbsp; jfv.**&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp; a&nbsp; Example*<o:p></o:p></span></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>The first line specifies that all classes under the
jfv package are persistent capable. This jfv package includes all the foreign
language classes created from C++. Our example program classes that are run are
Persistent Aware. The Example programs access persistent objects but are
themselves not written to the database. <o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB'>You can
run the enhancer by specifying: <o:p></o:p></span></p>

<pre style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>&nbsp; java com.versant.Enhance -out ../out -verbose -config ../config.vj .<o:p></o:p></span></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>You are now set to run your application program. To
run <tt><span style='mso-ansi-font-size:12.0pt;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman"'>Example2
</span></tt>use: <o:p></o:p></span></h2>

<pre style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>&nbsp; cd &lt;VERSANT_ROOT&gt;/demo/jvi/advanced/sharing/cpp/out&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp; java Example2 cppdb<o:p></o:p></span></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>The output of your program should be as follows: <o:p></o:p></span></h2>

<pre style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>Found Car instance:&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Manufacturer: Volvo&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Model: S280&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Year: 1996&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Retail Cost: 27660.0&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Doors: 4&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cylinders: 6&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Id: 187828<o:p></o:p></span></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>You have successfully accessed Car objects stored
from the C++ language interface from a Transparent JVI program. <o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='mso-ansi-font-size:12.0pt;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman";
mso-ansi-language:EN-GB'>Example2 </span></tt><span lang=EN-GB
style='mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB'>also updated the
retail cost of the Car instance stored from C++ and created a new instance
using the added on constructor method in the View class, and stored it in the
database. You can verify that these classes are stored correctly in the
database by running the C++ program </span><tt><span lang=EN-GB
style='mso-ansi-font-size:12.0pt;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman";
mso-ansi-language:EN-GB'>example2_main </span></tt><span lang=EN-GB
style='mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB'>with just a single
argument, the database name. Execute: the following messages to the <o:p></o:p></span></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><span
lang=EN-GB style='mso-ansi-font-size:12.0pt;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman";
mso-ansi-language:EN-GB'>example2_main cppdb</span></tt><span lang=EN-GB
style='mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB'> <o:p></o:p></span></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB'>As
mentioned earlier, the C++ program will select all Vehicle instances from the
database and print out their attributes. <o:p></o:p></span></p>

<pre style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>Found: Car:&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Manufacturer: Volvo&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Model: 860&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Year: 1996&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Retail Cost: 28660.00&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Doors: 4&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cylinders: 6&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Id: 187828&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>Found: Car:&nbsp;<o:p></o:p></span></pre><pre style='margin-left:.5in;
mso-outline-level:3'><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
10.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Manufacturer: Honda&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Model: Civic&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Year: 1997&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Retail Cost: 16770.50&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Doors: 2&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cylinders: 4&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Id: 837365<o:p></o:p></span></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>Notice that the Car object stored from C++ now has
its retail cost updated by $1000 from its original value. You can also find and
access the Car object created from the Transparent JVI program in the database
from the C++ language interface. So you now have successfully accessed Car
objects stored from the Transparent JVI program using the C++ language
interface . <o:p></o:p></span></h2>


<h2 align=center style='margin-left:.5in;text-align:center;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'>

<hr size=2 width="100%" align=center>

</span></h2>


<h1 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><a
name=s18 XXREF="#c18"></a><a href="#top"><span style='mso-bookmark:s18'></span></a><span
style='mso-bookmark:s18'></span><a href="#top" XXREF="#c18"><span
style='mso-bookmark:s18'></span></a><span style='mso-bookmark:s18'></span><a
href="#top" XXREF="#c18"><span style='mso-bookmark:s18'></span></a><span
style='mso-bookmark:s18'></span><a href="#top" XXREF="#c18"><span
style='mso-bookmark:s18'></span></a><span style='mso-bookmark:s18'></span><a
href="#top" XXREF="#c18"><span style='mso-bookmark:s18'></span></a><span
style='mso-bookmark:s18'></span><a href="#top" XXREF="#c18"><span
style='mso-bookmark:s18'></span></a><span style='mso-bookmark:s18'></span><a
href="#top" XXREF="#c18"><span style='mso-bookmark:s18'></span></a><span
style='mso-bookmark:s18'></span><a href="#top" XXREF="#c18"><span
style='mso-bookmark:s18'></span></a><span style='mso-bookmark:s18'></span><a
href="#top" XXREF="#c18"><span style='mso-bookmark:s18'></span></a><span
style='mso-bookmark:s18'></span><a href="#top" XXREF="#c18"><span
style='mso-bookmark:s18'></span></a><span style='mso-bookmark:s18'></span><a
href="#top" XXREF="#c18"><span style='mso-bookmark:s18'></span></a><span
style='mso-bookmark:s18'></span><a href="#top" XXREF="#c18"><span
style='mso-bookmark:s18'></span></a><span style='mso-bookmark:s18'></span><a
href="#top" XXREF="#c18"><span style='mso-bookmark:s18'></span></a><span
style='mso-bookmark:s18'></span><a href="#top" XXREF="#c18"><span
style='mso-bookmark:s18'></span></a><span style='mso-bookmark:s18'></span><a
href="#top" XXREF="#c18"><span style='mso-bookmark:s18'></span></a><span
style='mso-bookmark:s18'></span><a href="#top" XXREF="#c18"><span
style='mso-bookmark:s18'></span></a><span style='mso-bookmark:s18'></span><a
href="#top" XXREF="#c18"><span style='mso-bookmark:s18'></span></a><span
style='mso-bookmark:s18'></span><a href="#top" XXREF="#c18"><span
style='mso-bookmark:s18'></span></a><span style='mso-bookmark:s18'></span><a
href="#top" XXREF="#c18"><span style='mso-bookmark:s18'></span></a><span
style='mso-bookmark:s18'></span><a href="#top" XXREF="#c18"><span
style='mso-bookmark:s18'><span lang=EN-GB style='mso-ansi-language:EN-GB'>Chapter
7.</span></span><span style='mso-bookmark:s18'></span></a><span
style='mso-bookmark:s18'></span><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;
C++: Types to View Class Mapping<o:p></o:p></span></h1>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>The following table lists all VERSANT storage types
for C++ defined schema and the corresponding data types in the Java View class.
<o:p></o:p></span></h2>

<pre style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>C++ Attribute Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VERSANT Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Java View Class Type&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>-----------------------------------------------------------------------&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_1b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; byte&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_1b[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; byte[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_1b vstr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; java.lang.String&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; byte&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; char[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; byte[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; char vstr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; java.lang.String&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_u1b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_u1b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; short&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_u1b[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_u1b[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; short[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_u1b vstr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_u1b[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; short[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_2b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_2b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; short&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_2b[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_2b[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; short[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_2b vstr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_2b[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; short[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_u2b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_u2b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_u2b[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_u2b[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; </span><span
lang=DE style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:
DE'>o_u2b vstr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_u2b[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=DE style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:DE'>&nbsp;&nbsp; </span><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:
EN-GB'>o_4b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_4b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_4b[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_4b[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_4b vstr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_4b[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_u4b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_u4b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_u4b[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_u4b[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_u4b vstr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_u4b[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_8b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_8b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_8b[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_8b[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_8b vstr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_8b[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_u8b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_u8b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_u8b[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_u8b[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_u8b vstr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_u8b[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_float&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_float&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; float&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_float[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_float[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; float[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_float vstr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_float[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; float[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_double&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_double&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_double[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_double[FIXED]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; o_double vstr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_double[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; PString&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; java.lang.String&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; VString&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; java.lang.String&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; VDate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_4b (absolute days) java.util.Date&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; VTime&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_u4b (seconds)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; java.util.Date&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; d_Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; java.sql.Date&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; d_Interval&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_interval&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; d_Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; java.sql.Time&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; d_Timestamp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o_timestamp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; java.util.Date&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; Link&lt;CppObject&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CppObject&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CppObject&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; LinkVstr&lt;CppObject&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CppObject[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CppObject[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; LinkAny&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL_DOMAIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Handle&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp; LinkAnyVstr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL_DOMAIN[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Handle[]<o:p></o:p></span></pre>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'><br>
How to query on attributes of type VDate and d_Date of a C++ class using JFV <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB'>In JFV, an
attribute of type VDate of a C++ class is mapped to java.util.Date. Querying on
this attribute using <br>
java.util.Date requires conversion of java.util.Date to its absolute days and
it is as follows, <o:p></o:p></span></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB'>The total
number of absolute days since 1AD to the specified java.util.Date will be the
sum of the absolute days <br>
from 1AD to 1-Jan-1970 (a) and the absolute days from 1-Jan-1970 to the
specified java.util.Date (b). <br>
&nbsp;(a) The total number of absolute days from 1AD to 1-Jan-1970&nbsp; are
719163. <br>
&nbsp;(b) The total number of absolute days from 1-Jan-1970 to specified
java.util.Date can be calculated as <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( java.util.Date.getTime() / ( 3600000 * 24 ) ).
<o:p></o:p></span></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB'>The
following example shows the way in which a VDate field can be queried through
JFV application: <o:p></o:p></span></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;
long&nbsp; abs_number_days&nbsp; = ( d.getTime() / (3600000*24) ) + 719163; <br>
&nbsp;&nbsp; query = new VQLQuery (session, &quot;select selfoid from X where
X::date2.VDate::absolute_day_num = $1&quot;); <br>
&nbsp;&nbsp; query.bind (new Long (abs_number_days) ); <br>
&nbsp; <o:p></o:p></span></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB'>In JFV, an
attribute of type d_Date of a C++ class is mapped to java.sql.Date. Querying on
this attribute using <br>
java.sql.Date requires conversion of java.sql.Date to days. <o:p></o:p></span></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB'>The
following example shows the way in which a d_Date field can be queried through
JFV application: <o:p></o:p></span></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;
query = new VQLQuery (session, &quot;select selfoid from X where X::date3 =
$1&quot;); <br>
&nbsp;&nbsp;&nbsp;&nbsp; query.bind( new Long ( (d.getTime() / (3600000*24) )
); <br>
</span><b><span lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>&nbsp;
<o:p></o:p></span></b></p>


<h2 align=center style='margin-left:.5in;text-align:center;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'>

<hr size=2 width="100%" align=center>

</span></h2>


<h1 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><a
name=s19 XXREF="#c19"></a><a href="#top"><span style='mso-bookmark:s19'></span></a><span
style='mso-bookmark:s19'></span><a href="#top" XXREF="#c19"><span
style='mso-bookmark:s19'></span></a><span style='mso-bookmark:s19'></span><a
href="#top" XXREF="#c19"><span style='mso-bookmark:s19'></span></a><span
style='mso-bookmark:s19'></span><a href="#top" XXREF="#c19"><span
style='mso-bookmark:s19'></span></a><span style='mso-bookmark:s19'></span><a
href="#top" XXREF="#c19"><span style='mso-bookmark:s19'></span></a><span
style='mso-bookmark:s19'></span><a href="#top" XXREF="#c19"><span
style='mso-bookmark:s19'></span></a><span style='mso-bookmark:s19'></span><a
href="#top" XXREF="#c19"><span style='mso-bookmark:s19'></span></a><span
style='mso-bookmark:s19'></span><a href="#top" XXREF="#c19"><span
style='mso-bookmark:s19'></span></a><span style='mso-bookmark:s19'></span><a
href="#top" XXREF="#c19"><span style='mso-bookmark:s19'></span></a><span
style='mso-bookmark:s19'></span><a href="#top" XXREF="#c19"><span
style='mso-bookmark:s19'></span></a><span style='mso-bookmark:s19'></span><a
href="#top" XXREF="#c19"><span style='mso-bookmark:s19'></span></a><span
style='mso-bookmark:s19'></span><a href="#top" XXREF="#c19"><span
style='mso-bookmark:s19'></span></a><span style='mso-bookmark:s19'></span><a
href="#top" XXREF="#c19"><span style='mso-bookmark:s19'></span></a><span
style='mso-bookmark:s19'></span><a href="#top" XXREF="#c19"><span
style='mso-bookmark:s19'></span></a><span style='mso-bookmark:s19'></span><a
href="#top" XXREF="#c19"><span style='mso-bookmark:s19'></span></a><span
style='mso-bookmark:s19'></span><a href="#top" XXREF="#c19"><span
style='mso-bookmark:s19'></span></a><span style='mso-bookmark:s19'></span><a
href="#top" XXREF="#c19"><span style='mso-bookmark:s19'></span></a><span
style='mso-bookmark:s19'></span><a href="#top" XXREF="#c19"><span
style='mso-bookmark:s19'></span></a><span style='mso-bookmark:s19'></span><a
href="#top" XXREF="#c19"><span style='mso-bookmark:s19'></span></a><span
style='mso-bookmark:s19'></span><a href="#top" XXREF="#c19"><span
style='mso-bookmark:s19'><span lang=EN-GB style='mso-ansi-language:EN-GB'>Chapter
8.</span></span><span style='mso-bookmark:s19'></span></a><span
style='mso-bookmark:s19'></span><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;
C++: Sharing C++ Template Collection Classes<o:p></o:p></span></h1>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>When sharing Collection classes whose schema was
defined from C++ with Java it would be apt to reflect the functionality of the
C++ Collection class using a Java class that encapsulates the same
functionality. This way, a JVI programmer would readily have access to a Java
collection in the View class and methods of the JVI collection class can be
used to manipulate and access the contents of the collection in an appropriate
way. <o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB'>The table
below shows the mapping of C++ Collection classes to Java collection classes in
the View class. <o:p></o:p></span></p>

<pre style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>C++ Collection Class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Java Foreign View Class&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>-------------------------------------------------------------&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;<o:p></o:p></span></pre><pre style='margin-left:.5in;mso-outline-level:
3'><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;
font-family:"Times New Roman";mso-ansi-language:EN-GB'>VEArray&lt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>&nbsp; com.versant.util.DVector&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>VIArray&lt;&gt;&nbsp;<o:p></o:p></span></pre><pre style='margin-left:
.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
10.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>VVArray&lt;&gt;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;<o:p></o:p></span></pre><pre style='margin-left:.5in;mso-outline-level:
3'><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;
font-family:"Times New Roman";mso-ansi-language:EN-GB'>VEList&lt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>&nbsp;&nbsp; com.versant.util.CppList&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>VIList&lt;&gt;&nbsp;<o:p></o:p></span></pre><pre style='margin-left:
.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
10.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>VVList&lt;&gt;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;<o:p></o:p></span></pre><pre style='margin-left:.5in;mso-outline-level:
3'><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;
font-family:"Times New Roman";mso-ansi-language:EN-GB'>VESet&lt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>&nbsp; <span style="mso-spacerun: yes">&nbsp;</span>com.versant.util.CppHashSet&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>VISet&lt;&gt;&nbsp;<o:p></o:p></span></pre><pre style='margin-left:.5in;
mso-outline-level:3'><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
10.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>VVSet&lt;&gt;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>&nbsp;<o:p></o:p></span></pre><pre style='margin-left:.5in;mso-outline-level:
3'><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;
font-family:"Times New Roman";mso-ansi-language:EN-GB'>VEIDictionary&lt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; com.versant.util.CppHashMap&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>VIIDictionary&lt;&gt;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>VVIDictionary&lt;&gt;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>VEVDictionary&lt;&gt;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>VIVDictionary&lt;&gt;&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>VVVDictionary&lt;&gt;<o:p></o:p></span></pre>

<h2 style='margin-left:1.0in;text-indent:-.25in;mso-list:l1 level2 lfo12;
tab-stops:list 1.0in'><![if !supportLists]><span lang=EN-GB style='font-size:
10.0pt;mso-bidi-font-size:18.0pt;font-family:"Courier New";mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-GB;font-weight:normal'>o<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
18.0pt;mso-ansi-language:EN-GB;font-weight:normal'>Note that when defining
schema in C++, a template collection class can be defined to be a standalone
database object, or, an attribute of a persistent object. Consider the example
of a C++ Limousine class that contains </span><tt><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman";
mso-ansi-language:EN-GB;font-weight:normal'>VIArray&lt;Passenger&gt; passengers
</span></tt><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;
mso-ansi-language:EN-GB;font-weight:normal'>as an attribute. Passenger is a
persistent C++ class that derives from PObject. In the database, the schema for
the Limousine class would contain the following two embedded attributes which
contain the collection data:<o:p></o:p></span></h2>

<pre style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>Name: Limousine::passengers.VEArray&lt;Link&lt;PObject&gt;&gt;::elements&nbsp; Type:&nbsp; PObject[]&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>Name: Limousine::passengers.VEArray&lt;Link&lt;PObject&gt;&gt;::base&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type:&nbsp; o_4b<o:p></o:p></span></pre>

<h2 style='margin-left:1.0in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>The data contained in these two attributes can be
transparently read in to and written from the Java view class through the
Replacement class. The Limousine Java View class would contain a </span><tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-GB;font-weight:normal'>com.versant.util.DVector
passengers </span></tt><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
18.0pt;mso-ansi-language:EN-GB;font-weight:normal'>attribute. <o:p></o:p></span></h2>

<h2 style='margin-left:1.0in;text-indent:-.25in;mso-list:l1 level2 lfo12;
tab-stops:list 1.0in'><![if !supportLists]><span lang=EN-GB style='font-size:
10.0pt;mso-bidi-font-size:18.0pt;font-family:"Courier New";mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-GB;font-weight:normal'>o<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
18.0pt;mso-ansi-language:EN-GB;font-weight:normal'>Suppose the </span><tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-GB;font-weight:normal'>VIArray&lt;Passenger&gt;
</span></tt><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;
mso-ansi-language:EN-GB;font-weight:normal'>class were itself defined to be a
persistent object in the database, then a Java View class named: </span><tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-GB;font-weight:normal'>VIArray$L_PObject$R_.java
</span></tt><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;
mso-ansi-language:EN-GB;font-weight:normal'>is created for the corresponding
view class, and this class contains a </span><tt><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman";
mso-ansi-language:EN-GB;font-weight:normal'>com.versant.util.DVector </span></tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>attribute within. The </span><tt><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman";
mso-ansi-language:EN-GB;font-weight:normal'>$L_ </span></tt><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB;
font-weight:normal'>and </span><tt><span lang=EN-GB style='font-size:12.0pt;
mso-bidi-font-size:10.0pt;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
EN-GB;font-weight:normal'>$R_ </span></tt><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB;font-weight:normal'>additions
to the name follow a pattern of name mapping of C++ names to Java view classes
and this is described later.<o:p></o:p></span></h2>

<h2 style='margin-left:1.0in;text-indent:-.25in;mso-list:l1 level2 lfo12;
tab-stops:list 1.0in'><![if !supportLists]><span lang=EN-GB style='font-size:
10.0pt;mso-bidi-font-size:18.0pt;font-family:"Courier New";mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-GB;font-weight:normal'>o<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
18.0pt;mso-ansi-language:EN-GB;font-weight:normal'>Note that the </span><tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-GB;font-weight:normal'>VIList&lt;PObject&gt;
</span></tt><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;
mso-ansi-language:EN-GB;font-weight:normal'>type in C++ is a template
instantiation of a List of PObjects, and is strongly typed. The corresponding
Java View class mapping of a </span><tt><span lang=EN-GB style='font-size:12.0pt;
mso-bidi-font-size:10.0pt;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
EN-GB;font-weight:normal'>com.versant.util.DVector </span></tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>is not typed - the DVector </span><tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-GB;font-weight:normal'>addElement () </span></tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>methods accepts as an argument the generic type </span><tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-GB;font-weight:normal'>java.lang.Object </span></tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>so it is possible to insert an element that is not a
sub-class of PObject into the DVector. This would lead to run-time errors at
&quot;pickle&quot; time (i.e., when the view class object is being written to
the database via the transformations in the replacement class.) As a JVI
programmer you must be aware of the type of objects inserted into a C++
collection, and adhere to using the same type of elements from JVI. The JFV
implementation does no extra checking internally, to ensure that the types are
compatible.<o:p></o:p></span></h2>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c19.1"></a><a
href="#top" XXREF="#c19.1"></a><a href="#top" XXREF="#c19.1"></a><a href="#top"
XXREF="#c19.1"></a><a href="#top" XXREF="#c19.1"></a><a href="#top"
XXREF="#c19.1"></a><a href="#top" XXREF="#c19.1"></a><a href="#top"
XXREF="#c19.1"></a><a href="#top" XXREF="#c19.1"></a><a href="#top"
XXREF="#c19.1"></a><a href="#top" XXREF="#c19.1"></a><a href="#top"
XXREF="#c19.1"></a><a href="#top" XXREF="#c19.1"></a><a href="#top"
XXREF="#c19.1"></a><a href="#top" XXREF="#c19.1"></a><a href="#top"
XXREF="#c19.1"></a><a href="#top" XXREF="#c19.1"></a><a href="#top"
XXREF="#c19.1"></a><a href="#top" XXREF="#c19.1"></a><a href="#top"
XXREF="#c19.1"><span lang=EN-GB style='mso-ansi-language:EN-GB'>8.1.</span></a></span><a
name=s19.1></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
C++ to Java Class and Attribute Name Mappings<o:p></o:p></span></h2>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>When template classes are created as persistent
objects in C++, the class names in the database could contain the
&quot;&lt;&quot;, &quot;&gt;&quot;, and &quot;,&quot; characters in the name.
Creating a Java view class with the same characters in the name would be
illegal and lead to compilation errors as these characters are disallowed in
Java class names. Hence we map C++ class names to Java view class names. For
example, if the </span><tt><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB;font-weight:normal'>VEArray&lt;o_4b&gt;
</span></tt><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;
mso-ansi-language:EN-GB;font-weight:normal'>class is made persistent in C++,
this would map to a Java view class named: </span><tt><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB;font-weight:normal'>VEArray$L_o_4b$R_.java</span></tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'> <o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB'>Further,
attributes in the replacement class cannot always have identical names to
attributes in the C++ defined database schema. This happens if the database
attribute names contain the &quot;.&quot;, &quot;::&quot;, &quot;[&quot;, and
&quot;]&quot; characters. The table below shows the name mapping of C++ names
to Java View and Replacement class and attribute names. <o:p></o:p></span></p>

<pre style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>C++ Character&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Java Mapping&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>-------------------------------------------------------------&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; &lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $L_&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; </span><span
lang=DE style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:
DE'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $R_&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=DE style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:DE'>&nbsp;&nbsp;&nbsp; ,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $C_&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=DE style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:DE'>&nbsp;&nbsp;&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $D_&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=DE style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:DE'>&nbsp;&nbsp;&nbsp; ::&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $S_&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=DE style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:DE'>&nbsp;&nbsp;&nbsp; [&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $aL_&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:.5in;mso-outline-level:3'><span lang=DE style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:DE'>&nbsp;&nbsp;&nbsp; ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $aR_<o:p></o:p></span></pre>

<h2 align=center style='margin-left:.5in;text-align:center;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'>

<hr size=2 width="100%" align=center>

</span></h2>


<h1 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><a
name=s20 XXREF="#c20"></a><a href="#top"><span style='mso-bookmark:s20'></span></a><span
style='mso-bookmark:s20'></span><a href="#top" XXREF="#c20"><span
style='mso-bookmark:s20'></span></a><span style='mso-bookmark:s20'></span><a
href="#top" XXREF="#c20"><span style='mso-bookmark:s20'></span></a><span
style='mso-bookmark:s20'></span><a href="#top" XXREF="#c20"><span
style='mso-bookmark:s20'></span></a><span style='mso-bookmark:s20'></span><a
href="#top" XXREF="#c20"><span style='mso-bookmark:s20'></span></a><span
style='mso-bookmark:s20'></span><a href="#top" XXREF="#c20"><span
style='mso-bookmark:s20'></span></a><span style='mso-bookmark:s20'></span><a
href="#top" XXREF="#c20"><span style='mso-bookmark:s20'></span></a><span
style='mso-bookmark:s20'></span><a href="#top" XXREF="#c20"><span
style='mso-bookmark:s20'></span></a><span style='mso-bookmark:s20'></span><a
href="#top" XXREF="#c20"><span style='mso-bookmark:s20'></span></a><span
style='mso-bookmark:s20'></span><a href="#top" XXREF="#c20"><span
style='mso-bookmark:s20'></span></a><span style='mso-bookmark:s20'></span><a
href="#top" XXREF="#c20"><span style='mso-bookmark:s20'></span></a><span
style='mso-bookmark:s20'></span><a href="#top" XXREF="#c20"><span
style='mso-bookmark:s20'></span></a><span style='mso-bookmark:s20'></span><a
href="#top" XXREF="#c20"><span style='mso-bookmark:s20'></span></a><span
style='mso-bookmark:s20'></span><a href="#top" XXREF="#c20"><span
style='mso-bookmark:s20'></span></a><span style='mso-bookmark:s20'></span><a
href="#top" XXREF="#c20"><span style='mso-bookmark:s20'></span></a><span
style='mso-bookmark:s20'></span><a href="#top" XXREF="#c20"><span
style='mso-bookmark:s20'></span></a><span style='mso-bookmark:s20'></span><a
href="#top" XXREF="#c20"><span style='mso-bookmark:s20'></span></a><span
style='mso-bookmark:s20'></span><a href="#top" XXREF="#c20"><span
style='mso-bookmark:s20'></span></a><span style='mso-bookmark:s20'></span><a
href="#top" XXREF="#c20"><span style='mso-bookmark:s20'></span></a><span
style='mso-bookmark:s20'></span><a href="#top" XXREF="#c20"><span
style='mso-bookmark:s20'><span lang=EN-GB style='mso-ansi-language:EN-GB'>Chapter
9.</span></span><span style='mso-bookmark:s20'></span></a><span
style='mso-bookmark:s20'></span><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;
C++: Collections Example - The FloorPlan and Employee Classes<o:p></o:p></span></h1>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>In this part of the tutorial, we look at how
collection attributes in persistent C++ classes can be shared with transparent
JVI programs. <o:p></o:p></span></h2>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c20.1"></a><a
href="#top" XXREF="#c20.1"></a><a href="#top" XXREF="#c20.1"></a><a href="#top"
XXREF="#c20.1"></a><a href="#top" XXREF="#c20.1"></a><a href="#top"
XXREF="#c20.1"></a><a href="#top" XXREF="#c20.1"></a><a href="#top"
XXREF="#c20.1"></a><a href="#top" XXREF="#c20.1"></a><a href="#top"
XXREF="#c20.1"></a><a href="#top" XXREF="#c20.1"></a><a href="#top"
XXREF="#c20.1"></a><a href="#top" XXREF="#c20.1"></a><a href="#top"
XXREF="#c20.1"></a><a href="#top" XXREF="#c20.1"></a><a href="#top"
XXREF="#c20.1"></a><a href="#top" XXREF="#c20.1"></a><a href="#top"
XXREF="#c20.1"></a><a href="#top" XXREF="#c20.1"></a><a href="#top"
XXREF="#c20.1"><span lang=EN-GB style='mso-ansi-language:EN-GB'>9.1.</span></a></span><a
name=s20.1></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
The C++ FloorPlan and Employee Class<o:p></o:p></span></h2>

<p style='margin-left:35.4pt'><span lang=EN-GB style='mso-ansi-language:EN-GB'>The
C++ FloorPlan class contains a name attribute and a collection class attribute </span><tt><span
lang=EN-GB style='mso-ansi-font-size:12.0pt;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman";
mso-ansi-language:EN-GB'>cubesAssigned<b> </b></span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'>of type </span><tt><span lang=EN-GB
style='mso-ansi-font-size:12.0pt;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman";
mso-ansi-language:EN-GB'>VEIDictionary&lt;o_4b,Employee<b>&gt;. </b></span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The Dictionary maps cubicle numbers
to Employee instances designated to these cubicles. The Employee class contains
two attributes, a </span><tt><span lang=EN-GB style='mso-ansi-font-size:12.0pt;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman";
mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>name<b> </b></span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>attribute which is of type </span><tt><span
lang=EN-GB style='mso-ansi-font-size:12.0pt;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman";
mso-ansi-language:EN-GB'>PString<b> </b></span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'>and an </span><tt><span lang=EN-GB
style='mso-ansi-font-size:12.0pt;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman";
mso-ansi-language:EN-GB'>id<b> </b></span></tt><span lang=EN-GB
style='mso-ansi-language:EN-GB'>attribute which is of type </span><tt><span
lang=EN-GB style='mso-ansi-font-size:12.0pt;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman";
mso-ansi-language:EN-GB'>o_4b.</span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'> <o:p></o:p></span></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c20.2"></a><a
href="#top" XXREF="#c20.2"></a><a href="#top" XXREF="#c20.2"></a><a href="#top"
XXREF="#c20.2"></a><a href="#top" XXREF="#c20.2"></a><a href="#top"
XXREF="#c20.2"></a><a href="#top" XXREF="#c20.2"></a><a href="#top"
XXREF="#c20.2"></a><a href="#top" XXREF="#c20.2"></a><a href="#top"
XXREF="#c20.2"></a><a href="#top" XXREF="#c20.2"></a><a href="#top"
XXREF="#c20.2"></a><a href="#top" XXREF="#c20.2"></a><a href="#top"
XXREF="#c20.2"></a><a href="#top" XXREF="#c20.2"></a><a href="#top"
XXREF="#c20.2"></a><a href="#top" XXREF="#c20.2"></a><a href="#top"
XXREF="#c20.2"></a><a href="#top" XXREF="#c20.2"></a><a href="#top"
XXREF="#c20.2"><span lang=EN-GB style='mso-ansi-language:EN-GB'>9.2.</span></a></span><a
name=s20.2></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
FloorPlan Methods<o:p></o:p></span></h2>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>The FloorPlan class defines four methods: <o:p></o:p></span></h2>

<h2 style='margin-left:1.0in;text-indent:-.25in;mso-list:l1 level2 lfo12;
tab-stops:list 1.0in'><![if !supportLists]><span lang=EN-GB style='font-size:
10.0pt;mso-bidi-font-size:18.0pt;font-family:"Courier New";mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-GB;font-weight:normal'>o<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
18.0pt;mso-ansi-language:EN-GB;font-weight:normal'>The FloorPlan constructor
that takes 1 argument - the name of the floor plan.<o:p></o:p></span></h2>

<pre style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp; FloorPlan (PString aName) {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; VPP_CLASS_CONSTRUCTOR1 (FloorPlan);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; </span><span
lang=DE style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:
DE'>name = aName;&nbsp;<o:p></o:p></span></pre><pre style='margin-left:1.0in;
mso-outline-level:3'><span lang=DE style='font-size:12.0pt;mso-bidi-font-size:
10.0pt;mso-ansi-language:DE'>&nbsp; }<o:p></o:p></span></pre>

<h2 style='margin-left:1.0in;text-indent:-.25in;mso-list:l1 level2 lfo12;
tab-stops:list 1.0in'><![if !supportLists]><span lang=DE style='font-size:10.0pt;
mso-bidi-font-size:18.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman";
mso-ansi-language:DE;font-weight:normal'>o<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><span lang=DE style='font-size:12.0pt;mso-bidi-font-size:
18.0pt;mso-ansi-language:DE;font-weight:normal'>The FloorPlan destructor
method.<o:p></o:p></span></h2>

<h2 style='margin-left:1.0in;text-indent:-.25in;mso-list:l1 level2 lfo12;
tab-stops:list 1.0in'><![if !supportLists]><span lang=EN-GB style='font-size:
10.0pt;mso-bidi-font-size:18.0pt;font-family:"Courier New";mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-GB;font-weight:normal'>o<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
18.0pt;mso-ansi-language:EN-GB;font-weight:normal'>A </span><tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB;font-weight:normal'>print </span></tt><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB;
font-weight:normal'>method that prints out the attributes of the FloorPlan.
This includes all the cubicle numbers to employee assignments encapsulated
within the floor plan.<o:p></o:p></span></h2>

<pre style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp; void FloorPlan::print () {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; printf (&quot;FloorPlan: %s\n&quot;, name);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; int numCubes = cubesAssigned.size ();&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; numCubes; i++) {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Employee &amp;emp = cubesAssigned.index_value (i);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf (&quot;Cube No: %2d &quot;, cubesAssigned.index_key (i));&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
lang=DE style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:
DE'>emp.print ();&nbsp;<o:p></o:p></span></pre><pre style='margin-left:1.0in;
mso-outline-level:3'><span lang=DE style='font-size:12.0pt;mso-bidi-font-size:
10.0pt;mso-ansi-language:DE'>&nbsp;&nbsp;&nbsp; }&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=DE style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:DE'>&nbsp;&nbsp;&nbsp; printf (&quot;\n&quot;);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=DE style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:DE'>}<o:p></o:p></span></pre>

<h2 style='margin-left:1.0in;text-indent:-.25in;mso-list:l1 level2 lfo12;
tab-stops:list 1.0in'><![if !supportLists]><span lang=EN-GB style='font-size:
10.0pt;mso-bidi-font-size:18.0pt;font-family:"Courier New";mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-GB;font-weight:normal'>o<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
18.0pt;mso-ansi-language:EN-GB;font-weight:normal'>An </span><tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB;font-weight:normal'>addEmployee </span></tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>method that takes as arguments a cube number and an
employee assigned to the cube. This method inserts the Employee instance as a
value in the cubesAssigned dictionary, using the cube number as a key.<o:p></o:p></span></h2>

<pre style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp; void FloorPlan::addEmployee (o_4b cubeNo, Employee *anEmp)&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp; </span><span
lang=DE style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:
DE'>{&nbsp;<o:p></o:p></span></pre><pre style='margin-left:1.0in;mso-outline-level:
3'><span lang=DE style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:
DE'>&nbsp;&nbsp;&nbsp; cubesAssigned.add (cubeNo, *anEmp);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=DE style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:DE'>&nbsp; }<o:p></o:p></span></pre>

<h2 style='margin-left:1.0in;text-indent:-.25in;mso-list:l1 level2 lfo12;
tab-stops:list 1.0in'><![if !supportLists]><span lang=EN-GB style='font-size:
10.0pt;mso-bidi-font-size:18.0pt;font-family:"Courier New";mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-GB;font-weight:normal'>o<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
18.0pt;mso-ansi-language:EN-GB;font-weight:normal'>A </span><tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB;font-weight:normal'>findAll </span></tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>method that returns a </span><tt><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB;font-weight:normal'>LinkVstr </span></tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>of all the FloorPlan instances selected from the
database.<o:p></o:p></span></h2>

<pre style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp; LinkVstr&lt;FloorPlan&gt; FloorPlan::findAll ()&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp; {&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; return PClassObject&lt;FloorPlan&gt;::Object().select (NULL,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FALSE,&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL_PREDICATE);&nbsp;<o:p></o:p></span></pre><pre
style='margin-left:1.0in;mso-outline-level:3'><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>&nbsp; }<o:p></o:p></span></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>The C++ FloorPlan and Employee class header and
implementation files, </span><tt><span lang=EN-GB style='font-size:12.0pt;
mso-bidi-font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB;
font-weight:normal'>floorPlan.h, employee.h, floorPlan.cxx, </span></tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>and </span><tt><span lang=EN-GB style='font-size:
12.0pt;mso-bidi-font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB;font-weight:normal'>employee.cxx </span></tt><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:EN-GB;
font-weight:normal'>can be found in your </span><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB;
font-weight:normal'>&lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB;font-weight:normal'>/sharing/cpp/cppsrc </span></tt><span
lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:18.0pt;mso-ansi-language:
EN-GB;font-weight:normal'>directory. <o:p></o:p></span></h2>

<h3 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c20.2.1"></a><a
href="#top" XXREF="#c20.2.1"></a><a href="#top" XXREF="#c20.2.1"></a><a
href="#top" XXREF="#c20.2.1"></a><a href="#top" XXREF="#c20.2.1"></a><a
href="#top" XXREF="#c20.2.1"></a><a href="#top" XXREF="#c20.2.1"></a><a
href="#top" XXREF="#c20.2.1"></a><a href="#top" XXREF="#c20.2.1"></a><a
href="#top" XXREF="#c20.2.1"></a><a href="#top" XXREF="#c20.2.1"></a><a
href="#top" XXREF="#c20.2.1"></a><a href="#top" XXREF="#c20.2.1"></a><a
href="#top" XXREF="#c20.2.1"></a><a href="#top" XXREF="#c20.2.1"></a><a
href="#top" XXREF="#c20.2.1"></a><a href="#top" XXREF="#c20.2.1"></a><a
href="#top" XXREF="#c20.2.1"></a><a href="#top" XXREF="#c20.2.1"></a><a
href="#top" XXREF="#c20.2.1"><span lang=EN-GB style='mso-ansi-language:EN-GB'>9.2.1.</span></a></span><a
name=s20.2.1></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Creating the Schema<o:p></o:p></span></h3>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Recall that in C++, you need to
create an </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>.imp </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>file and run the schema compiler so that you create a </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>.sch </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>schema
file. The </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>.imp </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>file for this example, called </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>example3.imp
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>captures the
schema of the FloorPlan and Employee classes and is provided in the </span><span
lang=EN-GB style='font-size:10.0pt;mso-ansi-language:EN-GB'>&lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>/sharing/cpp/cppsrc/ </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>directory. To run the schema compiler, you must run the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>schcomp </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>utility
as follows: <o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><b><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>schcomp -<st1:place w:st="on">I.</st1:place> -Iplatform-dir/h
example3.imp</span></b></tt><b><span lang=EN-GB style='font-size:18.0pt;
mso-ansi-language:EN-GB'> <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><b><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>On HP platform you need to use flag -DHP11 for schcomp i.e.</span></b></tt><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'> <br>
</span></b><tt><b><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>schcomp -DHP11 -<st1:place w:st="on">I.</st1:place>
-Iplatform-dir/h example3.imp</span></b></tt><b><span lang=EN-GB
style='font-size:18.0pt;mso-ansi-language:EN-GB'> <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>where
&quot;platform-dir&quot; is the name of your Versant installation directory. On
running the schema compiler, you will obtain two files: </span></b><tt><b><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>example3.cxx </span></b></tt><b><span lang=EN-GB style='font-size:18.0pt;
mso-ansi-language:EN-GB'>and </span></b><tt><b><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>example3.sch.
example3.cxx can now be compiled along with </span></b></tt><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>the FloorPlan and
Employee header and implementation files, floorPlan.h, employee.h,
floorPlan.cxx and employee.cxx and the main C++ program. <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>To create the
schema in the database, run the schema to database utility as follows: <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><b><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>sch2db -d cppdb example3.sch</span></b></tt><b><span lang=EN-GB
style='font-size:18.0pt;mso-ansi-language:EN-GB'> <o:p></o:p></span></b></p>

<h3 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c20.2.2"></a><a
href="#top" XXREF="#c20.2.2"></a><a href="#top" XXREF="#c20.2.2"></a><a
href="#top" XXREF="#c20.2.2"></a><a href="#top" XXREF="#c20.2.2"></a><a
href="#top" XXREF="#c20.2.2"></a><a href="#top" XXREF="#c20.2.2"></a><a
href="#top" XXREF="#c20.2.2"></a><a href="#top" XXREF="#c20.2.2"></a><a
href="#top" XXREF="#c20.2.2"></a><a href="#top" XXREF="#c20.2.2"></a><a
href="#top" XXREF="#c20.2.2"></a><a href="#top" XXREF="#c20.2.2"></a><a
href="#top" XXREF="#c20.2.2"></a><a href="#top" XXREF="#c20.2.2"></a><a
href="#top" XXREF="#c20.2.2"></a><a href="#top" XXREF="#c20.2.2"></a><a
href="#top" XXREF="#c20.2.2"></a><a href="#top" XXREF="#c20.2.2"></a><a
href="#top" XXREF="#c20.2.2"><span lang=EN-GB style='mso-ansi-language:EN-GB'>9.2.2.</span></a></span><a
name=s20.2.2></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
The C++ Program<o:p></o:p></span></h3>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The main routine of the C++ program
can be found in the file </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>example3_main.cxx </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>in the </span><span lang=EN-GB
style='font-size:10.0pt;mso-ansi-language:EN-GB'>&lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>/sharing/cpp/cppsrc </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>directory. A </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>Makefile </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>is also provided in the </span><span
lang=EN-GB style='font-size:10.0pt;mso-ansi-language:EN-GB'>&lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>/sharing/cpp/cppsrc </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>directory and you can run </span><tt><span lang=EN-GB style='font-size:
10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>make </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>on Unix platforms or </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>nmake </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>on NT
to obtain the </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:
"Courier New";mso-ansi-language:EN-GB'>example3_main </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>executable. <o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>When run with a second
argument string of &quot;create&quot;, the example program creates a FloorPlan
instance in the database, creates some Employees and assignes these employees
to cubes in the floor plan. <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>(Otherwise, the
example program does a select on FloorPlan instances in the database.) Run the
following command to create a FloorPlan instance <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><b><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>example3_main cppdb create</span></b></tt><b><span lang=EN-GB
style='font-size:18.0pt;mso-ansi-language:EN-GB'> <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>The output is as
follows: <o:p></o:p></span></b></p>

<pre style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>FloorPlan: Acounting&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>Cube No:&nbsp; 1 Employee: Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; John Davis&nbsp;&nbsp; Id:&nbsp;&nbsp; 182&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>Cube No:&nbsp; 3 Employee: Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Beth Sterns&nbsp;&nbsp; Id:&nbsp;&nbsp; 206&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>Cube No: 11 Employee: Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Steve Harmon&nbsp;&nbsp; Id:&nbsp;&nbsp; 336&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>Cube No: 18 Employee: Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Seth Goldman&nbsp;&nbsp; Id:&nbsp;&nbsp; 688<o:p></o:p></span></b></pre>

<h2 align=center style='margin-left:.5in;text-align:center;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'>

<hr size=2 width="100%" align=center>

</span></h2>


<h1 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><a
name=s21 XXREF="#c21"></a><a href="#top"><span style='mso-bookmark:s21'></span></a><span
style='mso-bookmark:s21'></span><a href="#top" XXREF="#c21"><span
style='mso-bookmark:s21'></span></a><span style='mso-bookmark:s21'></span><a
href="#top" XXREF="#c21"><span style='mso-bookmark:s21'></span></a><span
style='mso-bookmark:s21'></span><a href="#top" XXREF="#c21"><span
style='mso-bookmark:s21'></span></a><span style='mso-bookmark:s21'></span><a
href="#top" XXREF="#c21"><span style='mso-bookmark:s21'></span></a><span
style='mso-bookmark:s21'></span><a href="#top" XXREF="#c21"><span
style='mso-bookmark:s21'></span></a><span style='mso-bookmark:s21'></span><a
href="#top" XXREF="#c21"><span style='mso-bookmark:s21'></span></a><span
style='mso-bookmark:s21'></span><a href="#top" XXREF="#c21"><span
style='mso-bookmark:s21'></span></a><span style='mso-bookmark:s21'></span><a
href="#top" XXREF="#c21"><span style='mso-bookmark:s21'></span></a><span
style='mso-bookmark:s21'></span><a href="#top" XXREF="#c21"><span
style='mso-bookmark:s21'></span></a><span style='mso-bookmark:s21'></span><a
href="#top" XXREF="#c21"><span style='mso-bookmark:s21'></span></a><span
style='mso-bookmark:s21'></span><a href="#top" XXREF="#c21"><span
style='mso-bookmark:s21'></span></a><span style='mso-bookmark:s21'></span><a
href="#top" XXREF="#c21"><span style='mso-bookmark:s21'></span></a><span
style='mso-bookmark:s21'></span><a href="#top" XXREF="#c21"><span
style='mso-bookmark:s21'></span></a><span style='mso-bookmark:s21'></span><a
href="#top" XXREF="#c21"><span style='mso-bookmark:s21'></span></a><span
style='mso-bookmark:s21'></span><a href="#top" XXREF="#c21"><span
style='mso-bookmark:s21'></span></a><span style='mso-bookmark:s21'></span><a
href="#top" XXREF="#c21"><span style='mso-bookmark:s21'></span></a><span
style='mso-bookmark:s21'></span><a href="#top" XXREF="#c21"><span
style='mso-bookmark:s21'></span></a><span style='mso-bookmark:s21'></span><a
href="#top" XXREF="#c21"><span style='mso-bookmark:s21'></span></a><span
style='mso-bookmark:s21'></span><a href="#top" XXREF="#c21"><span
style='mso-bookmark:s21'><span lang=EN-GB style='mso-ansi-language:EN-GB'>Chapter
10.</span></span><span style='mso-bookmark:s21'></span></a><span
style='mso-bookmark:s21'></span><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;
C++: Sharing The FloorPlan and Employee Classes with JVI<o:p></o:p></span></h1>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c21.1"></a><a
href="#top" XXREF="#c21.1"></a><a href="#top" XXREF="#c21.1"></a><a href="#top"
XXREF="#c21.1"></a><a href="#top" XXREF="#c21.1"></a><a href="#top"
XXREF="#c21.1"></a><a href="#top" XXREF="#c21.1"></a><a href="#top"
XXREF="#c21.1"></a><a href="#top" XXREF="#c21.1"></a><a href="#top"
XXREF="#c21.1"></a><a href="#top" XXREF="#c21.1"></a><a href="#top"
XXREF="#c21.1"></a><a href="#top" XXREF="#c21.1"></a><a href="#top"
XXREF="#c21.1"></a><a href="#top" XXREF="#c21.1"></a><a href="#top"
XXREF="#c21.1"></a><a href="#top" XXREF="#c21.1"></a><a href="#top"
XXREF="#c21.1"></a><a href="#top" XXREF="#c21.1"></a><a href="#top"
XXREF="#c21.1"><span lang=EN-GB style='mso-ansi-language:EN-GB'>10.1.</span></a></span><a
name=s21.1></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Generating the View and Replacement Class<o:p></o:p></span></h2>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>We have created the schema for the
FloorPlan and Employee classes and created persistent instances of the classes
from the C++ language interface. The tutorial now illustrates how a Transparent
JVI program can access an instance of the FloorPlan class. <o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>The first stage in
developing the Transparent JVI application is to generate View and Replacement
classes for the schema defined from C++. <o:p></o:p></span></b></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c21.2"></a><a
href="#top" XXREF="#c21.2"></a><a href="#top" XXREF="#c21.2"></a><a href="#top"
XXREF="#c21.2"></a><a href="#top" XXREF="#c21.2"></a><a href="#top"
XXREF="#c21.2"></a><a href="#top" XXREF="#c21.2"></a><a href="#top"
XXREF="#c21.2"></a><a href="#top" XXREF="#c21.2"></a><a href="#top"
XXREF="#c21.2"></a><a href="#top" XXREF="#c21.2"></a><a href="#top"
XXREF="#c21.2"></a><a href="#top" XXREF="#c21.2"></a><a href="#top"
XXREF="#c21.2"></a><a href="#top" XXREF="#c21.2"></a><a href="#top"
XXREF="#c21.2"></a><a href="#top" XXREF="#c21.2"></a><a href="#top"
XXREF="#c21.2"></a><a href="#top" XXREF="#c21.2"></a><a href="#top"
XXREF="#c21.2"><span lang=EN-GB style='mso-ansi-language:EN-GB'>10.2.</span></a></span><a
name=s21.2></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Running com.versant.Db2Java on cppdb<o:p></o:p></span></h2>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>You are now ready to run the Object
Sharing Java generation program on the C++ database that you have created and
populated. We are working in the </span><span lang=EN-GB style='font-size:10.0pt;
mso-ansi-language:EN-GB'>&lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>/sharing/cpp/in </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>directory. You must first cd to that directory: <o:p></o:p></span></h2>

<pre style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; cd </span></b><b style='mso-bidi-font-weight:
normal'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&lt;VERSANT_ROOT&gt;/demo/jvi/advanced<span
style='mso-bidi-font-weight:bold'>/sharing/cpp/in<o:p></o:p></span></span></b></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Recall that running the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>com.versant.Db2Java </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>program in this directory will create a new </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>jfv </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>directory with Java source for the
C++ Foreign Language classes stored within. You can now run the Java program as
shown: <o:p></o:p></span></h2>

<pre style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; java com.versant.Db2Java -d cppdb -class FloorPlan Employee -verbose<o:p></o:p></span></b></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>We use the </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>-class FloorPlan Employee </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>option since we know that FloorPlan and Employee were the only C++ class
added since the previous run of the </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>com.versant.Db2Java
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>tool. Alternately,
you can also use the </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>-force </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>option and avoid specifying the
class name. This will result in .java source files for all the C++ classes in
the database being regenerated. <o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>After executing the
program, change directory into the &quot;jfv&quot; directory from the
&quot;in&quot; directory. <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><b><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>cd jfv</span></b></tt><b><span lang=EN-GB style='font-size:18.0pt;
mso-ansi-language:EN-GB'> <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>If you list the
files in this directory, you should now see the following new files: <o:p></o:p></span></b></p>

<pre style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; Employee.java&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; Employee_Rep.java&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; FloorPlan.java&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; FloorPlan_Rep.java<o:p></o:p></span></b></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c21.3"></a><a
href="#top" XXREF="#c21.3"></a><a href="#top" XXREF="#c21.3"></a><a href="#top"
XXREF="#c21.3"></a><a href="#top" XXREF="#c21.3"></a><a href="#top"
XXREF="#c21.3"></a><a href="#top" XXREF="#c21.3"></a><a href="#top"
XXREF="#c21.3"></a><a href="#top" XXREF="#c21.3"></a><a href="#top"
XXREF="#c21.3"></a><a href="#top" XXREF="#c21.3"></a><a href="#top"
XXREF="#c21.3"></a><a href="#top" XXREF="#c21.3"></a><a href="#top"
XXREF="#c21.3"></a><a href="#top" XXREF="#c21.3"></a><a href="#top"
XXREF="#c21.3"></a><a href="#top" XXREF="#c21.3"></a><a href="#top"
XXREF="#c21.3"></a><a href="#top" XXREF="#c21.3"></a><a href="#top"
XXREF="#c21.3"><span lang=EN-GB style='mso-ansi-language:EN-GB'>10.3.</span></a></span><a
name=s21.3></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
View Class for FloorPlan<o:p></o:p></span></h2>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Let us now look at the generated source
for the FloorPlan class. <o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>FloorPlan.java: <o:p></o:p></span></b></p>

<pre style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>package jfv;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>import com.versant.fund.*;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>import com.versant.trans.*;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>import com.versant.util.*;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>import java.util.*;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>/* JFV View Class for db schema: FloorPlan */&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>public class FloorPlan&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>extends PObject&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>{&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; static {&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; com.versant.trans.JfvClassMap.java2sch.put (&quot;jfv.FloorPlan&quot;, &quot;FloorPlan&quot;);&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; }&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; /* View Class Attributes */&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; public java.lang.String name;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; public com.versant.util.CppHashMap cubesAssigned;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>}<o:p></o:p></span></b></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The FloorPlan View class contains </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>java.lang.String name </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>and </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:
"Courier New";mso-ansi-language:EN-GB'>com.versant.util.CppHashMap
cubesAssigned </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>attributes.
Recall that we defined the attributes to be of types </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>PString </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>and
</span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
mso-ansi-language:EN-GB'>VEIDictionary&lt;o_4b,Employee&gt; </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>respectively in the C++ class. This
resulted in the attributes being stored to the VERSANT database as </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>char[] </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>for
the PString attribute, and a four-tuple that represents the contents of the
VEIDictionary attribute: </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>keys o_4b[] values PObject[]
table o_4b[] </span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>and </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>links o_4b[].</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>
<o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>Hence, in the Java
View class that you can utilize in your transparent applications, the
attributes are projected as a Java </span></b><tt><b><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>String
</span></b></tt><b><span lang=EN-GB style='font-size:18.0pt;mso-ansi-language:
EN-GB'>and a </span></b><tt><b><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>com.versant.util.CppHashMap </span></b></tt><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>collection type
respectively. For a complete set of mappings, refer to the chapter <i>C++ Types
to View Class Mapping.</i> <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>The access
modifiers for these View class attributes are &quot;public&quot;. If you want
to change it, you can edit the View class source. <o:p></o:p></span></b></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c21.4"></a><a
href="#top" XXREF="#c21.4"></a><a href="#top" XXREF="#c21.4"></a><a href="#top"
XXREF="#c21.4"></a><a href="#top" XXREF="#c21.4"></a><a href="#top"
XXREF="#c21.4"></a><a href="#top" XXREF="#c21.4"></a><a href="#top"
XXREF="#c21.4"></a><a href="#top" XXREF="#c21.4"></a><a href="#top"
XXREF="#c21.4"></a><a href="#top" XXREF="#c21.4"></a><a href="#top"
XXREF="#c21.4"></a><a href="#top" XXREF="#c21.4"></a><a href="#top"
XXREF="#c21.4"></a><a href="#top" XXREF="#c21.4"></a><a href="#top"
XXREF="#c21.4"></a><a href="#top" XXREF="#c21.4"></a><a href="#top"
XXREF="#c21.4"></a><a href="#top" XXREF="#c21.4"></a><a href="#top"
XXREF="#c21.4"><span lang=EN-GB style='mso-ansi-language:EN-GB'>10.4.</span></a></span><a
name=s21.4></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Replacement Class for FloorPlan<o:p></o:p></span></h2>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Let us now look at the Java source
for the Replacement FloorPlan class. <o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>FloorPlan_Rep.java <o:p></o:p></span></b></p>

<pre style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>package jfv;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>import com.versant.fund.*;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>import com.versant.trans.*;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>import com.versant.util.*;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>import java.util.*;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>/* JFV Replacement Class for db schema: FloorPlan */&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>public class FloorPlan_Rep&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>extends PObject_Rep&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>{&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; /* Replacement Class Attributes */&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; public byte[] FloorPlan$S_name;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; public int[] FloorPlan$S_cubesAssigned$D_VEEDictionary$L_o_4b$C_Link$L_PObject$R_$R_$S_keys;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; public Handle[] FloorPlan$S_cubesAssigned$D_VEEDictionary$L_o_4b$C_Link$L_PObject$R_$R_$S_values;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; public int[] FloorPlan$S_cubesAssigned$D_VEEDictionary$L_o_4b$C_Link$L_PObject$R_$R_$S_table;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; public int[] FloorPlan$S_cubesAssigned$D_VEEDictionary$L_o_4b$C_Link$L_PObject$R_$R_$S_links;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; /* Copy to Replacement Class prior to pickling */&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; public void copyPrePickle (java.lang.Object jfvViewObj)&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; {&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; super.copyPrePickle (jfvViewObj);&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; FloorPlan jfvView = (FloorPlan) jfvViewObj;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; this.FloorPlan$S_name = JfvUtilities.CPP_getByteArrayFromString (jfvView.name);&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; this.FloorPlan$S_cubesAssigned$D_VEEDictionary$L_o_4b$C_Link$L_PObject$R_$R_$S_keys = JfvUtilities.CPP_get4bKeysArrayFromCppHashMap (jfvView.cubesAssigned);&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; this.FloorPlan$S_cubesAssigned$D_VEEDictionary$L_o_4b$C_Link$L_PObject$R_$R_$S_values = JfvUtilities.CPP_getValuesArrayFromCppHashMap (jfvView.cubesAssigned);&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; this.FloorPlan$S_cubesAssigned$D_VEEDictionary$L_o_4b$C_Link$L_PObject$R_$R_$S_table = JfvUtilities.CPP_getTableArrayFromCppHashMap (jfvView.cubesAssigned);&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; this.FloorPlan$S_cubesAssigned$D_VEEDictionary$L_o_4b$C_Link$L_PObject$R_$R_$S_links = JfvUtilities.CPP_getLinksArrayFromCppHashMap (jfvView.cubesAssigned);&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; }&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; /* Copy from Replacement Class after unpickling */&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; public void copyPostUnpickle (java.lang.Object jfvViewObj)&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; {&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; super.copyPostUnpickle (jfvViewObj);&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; FloorPlan jfvView = (FloorPlan) jfvViewObj;&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp; jfvView.name = JfvUtilities.CPP_getStringFromByteArray (this.FloorPlan$S_name);&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jfvView.cubesAssigned = JfvUtilities.CPP_getCppHashMapFrom4bArray (this.FloorPlan$S_cubesAssigned$D_VEEDictionary$L_o_4b$C_Link$L_PObject$R_$R_$S_keys, this.FloorPlan$S_cubesAssigned$D_VEEDictionary$L_o_4b$C_Link$L_PObject$R_$R_$S_values, this.FloorPlan$S_cubesAssigned$D_VEEDictionary$L_o_4b$C_Link$L_PObject$R_$R_$S_table, this.FloorPlan$S_cubesAssigned$D_VEEDictionary$L_o_4b$C_Link$L_PObject$R_$R_$S_links);&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; }&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>}<o:p></o:p></span></b></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c21.5"></a><a
href="#top" XXREF="#c21.5"></a><a href="#top" XXREF="#c21.5"></a><a href="#top"
XXREF="#c21.5"></a><a href="#top" XXREF="#c21.5"></a><a href="#top"
XXREF="#c21.5"></a><a href="#top" XXREF="#c21.5"></a><a href="#top"
XXREF="#c21.5"></a><a href="#top" XXREF="#c21.5"></a><a href="#top"
XXREF="#c21.5"></a><a href="#top" XXREF="#c21.5"></a><a href="#top"
XXREF="#c21.5"></a><a href="#top" XXREF="#c21.5"></a><a href="#top"
XXREF="#c21.5"></a><a href="#top" XXREF="#c21.5"></a><a href="#top"
XXREF="#c21.5"></a><a href="#top" XXREF="#c21.5"></a><a href="#top"
XXREF="#c21.5"></a><a href="#top" XXREF="#c21.5"></a><a href="#top"
XXREF="#c21.5"><span lang=EN-GB style='mso-ansi-language:EN-GB'>10.5.</span></a></span><a
name=s21.5></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Copying Prior to Pickling and After Unpickling<o:p></o:p></span></h2>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>FloorPlan_Rep
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>Java source code
contains the </span><tt><span lang=EN-GB style='font-size:10.0pt;font-family:
"Courier New";mso-ansi-language:EN-GB'>copyPrePickle </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>and </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>copyPostUnpickle
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>methods that
illustrate transformations between the View class attributes and the
Replacement class attributes. Recall that </span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>copyPrePickle
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>copies an object,
attribute by attribute from the View instance into a Replacement instance
before the object is stored (pickled) to the database. </span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>copyPostUnpickle </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>copies an object, attribute by attribute from the Replacement instance
into a View instance when the object is read (unpickled) from the database. <o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>In the FloorPlan
class, the </span></b><tt><b><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>name </span></b></tt><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>attribute is a byte
array in the replacement class and a String in the view class, hence the
utility methods in </span></b><tt><b><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>JfvUtilities.CPP_getByteArrayFromString
(String) </span></b></tt><b><span lang=EN-GB style='font-size:18.0pt;
mso-ansi-language:EN-GB'>and </span></b><tt><b><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>JfvUtilities.CPP_getStringFromByteArray
(byte[]) </span></b></tt><b><span lang=EN-GB style='font-size:18.0pt;
mso-ansi-language:EN-GB'>are called during pickling and unpickling the view
class from the database. The </span></b><tt><b><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>cubesAssigned
</span></b></tt><b><span lang=EN-GB style='font-size:18.0pt;mso-ansi-language:
EN-GB'>attribute which is of type </span></b><tt><b><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>com.versant.util.CppHashMap
</span></b></tt><b><span lang=EN-GB style='font-size:18.0pt;mso-ansi-language:
EN-GB'>in the view class goes through a more complex transformation. The four attributes
in the replacement class (and the database) which represent the VEIDictionary
contents are mapped to the CppHashMap attribute in the View class, and
appropriate JfvUtility methods used in transformations. The following methods
return </span></b><tt><b><span lang=EN-GB style='font-size:10.0pt;font-family:
"Courier New";mso-ansi-language:EN-GB'>keys o_4b[] values PObject[] table
o_4b[] </span></b></tt><b><span lang=EN-GB style='font-size:18.0pt;mso-ansi-language:
EN-GB'>and </span></b><tt><b><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>links o_4b[] </span></b></tt><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>from the CppHashMap
argument during pickling: </span></b><tt><b><span lang=EN-GB style='font-size:
10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>JfvUtilities.CPP_get4bKeysArrayFromCppHashMap
(CppHashMap) JfvUtilities.CPP_getValuesArrayFromCppHashMap (CppHashMap)
JfvUtilities.CPP_getTableArrayFromCppHashMap (CppHashMap)
JfvUtilities.CPP_getLinksArrayFromCppHashMap (CppHashMap) </span></b></tt><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>For unpickling, the
JfvUtility method: </span></b><tt><b><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>JfvUtilities.CPP_getCppHashMapFrom4bArray
(o_4b[], PObject[], o_4b[], o_4b[]) </span></b></tt><b><span lang=EN-GB
style='font-size:18.0pt;mso-ansi-language:EN-GB'>returns a CppHashMap from the
database attributes representing a VEIDictionary. <o:p></o:p></span></b></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c21.6"></a><a
href="#top" XXREF="#c21.6"></a><a href="#top" XXREF="#c21.6"></a><a href="#top"
XXREF="#c21.6"></a><a href="#top" XXREF="#c21.6"></a><a href="#top"
XXREF="#c21.6"></a><a href="#top" XXREF="#c21.6"></a><a href="#top"
XXREF="#c21.6"></a><a href="#top" XXREF="#c21.6"></a><a href="#top"
XXREF="#c21.6"></a><a href="#top" XXREF="#c21.6"></a><a href="#top"
XXREF="#c21.6"></a><a href="#top" XXREF="#c21.6"></a><a href="#top"
XXREF="#c21.6"></a><a href="#top" XXREF="#c21.6"></a><a href="#top"
XXREF="#c21.6"></a><a href="#top" XXREF="#c21.6"></a><a href="#top"
XXREF="#c21.6"></a><a href="#top" XXREF="#c21.6"></a><a href="#top"
XXREF="#c21.6"><span lang=EN-GB style='mso-ansi-language:EN-GB'>10.6.</span></a></span><a
name=s21.6></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
The Transparent JVI Application<o:p></o:p></span></h2>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>You are ready to use the FloorPlan
class in a Transparent JVI application program. The application has already
been provided to you in the </span><span lang=EN-GB style='font-size:10.0pt;
mso-ansi-language:EN-GB'>&lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>/sharing/cpp/in </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>directory. The file </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>Example3.java </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>illustrates how a Transparent JVI
program could use the FloorPlan class. <o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>In the example
program, we select all FloorPlan instances from the database. Then we print out
all the cube assignments (i.e., the cube number with the employee assigned to
the cube). This is done by obtaining an iterator on the keys of the CppHashMap
through calling the </span></b><tt><b><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>CppHashMap.keys () </span></b></tt><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>method. The
iterator is traversed using the </span></b><tt><b><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>CppHashMapIterator.hasNext
() </span></b></tt><b><span lang=EN-GB style='font-size:18.0pt;mso-ansi-language:
EN-GB'>and </span></b><tt><b><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>CppHashMapIterator.next () </span></b></tt><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>methods. The value
mapped against a key in the CppHashMap (i.e. the Employee instance in this
example) is obtained based on the key using the </span></b><tt><b><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>CppHashMap.get (Object key) </span></b></tt><b><span lang=EN-GB
style='font-size:18.0pt;mso-ansi-language:EN-GB'>method. <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>We also create a
new assignment of a cube to an employee before commiting the session. <br>
import jfv.*; <br>
import com.versant.trans.*; <br>
import com.versant.fund.*; <br>
import com.versant.util.*; <br>
import java.util.*; <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>public class
Example3 <br>
{ <br>
&nbsp; public static void main (String[] args) { <br>
&nbsp;&nbsp;&nbsp; if (args.length &lt; 1) { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.err.println (&quot;Usage: java Example3
&lt;dbname&gt;&quot;); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.exit (1); <br>
&nbsp;&nbsp;&nbsp; } <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;
Properties p = new Properties (); <br>
&nbsp;&nbsp;&nbsp; p.setProperty (&quot;database&quot;, args[0]); <br>
&nbsp;&nbsp;&nbsp; p.setProperty(&quot;useJFV&quot; , &quot;true&quot;); <br>
&nbsp;&nbsp;&nbsp; TransSession s = new TransSession (p); <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;
VQLQuery query = new VQLQuery (s, &quot;select selfoid from FloorPlan&quot;); <br>
&nbsp;&nbsp;&nbsp; Enumeration e = query.execute (); <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;
if (!e.hasMoreElements()) { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println (&quot;No FloorPlan instances
were found.&quot;); <br>
&nbsp;&nbsp;&nbsp; } <br>
&nbsp;&nbsp;&nbsp; else { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while ( e.hasMoreElements() ) { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jfv.FloorPlan fp = (jfv.FloorPlan)
e.nextElement (); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CppHashMapIterator keys =
fp.cubesAssigned.keys (); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (keys.hasNext ()) { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Object key = keys.next
(); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jfv.Employee emp =
(jfv.Employee) fp.cubesAssigned.get (key); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println
(&quot;Cube: &quot; + key + <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot;&nbsp; Employee: &quot; + <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot;Name: &quot; + emp.name + &quot;&nbsp; Id: &quot; + emp.id); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jfv.Employee newEmp = new Employee
(); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newEmp.name = new String (&quot;Gary
Stevenson&quot;); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newEmp.id = 108; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s.makePersistent (newEmp); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fp.cubesAssigned.put (new Integer
(20), newEmp); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>
&nbsp;&nbsp;&nbsp; } <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;
s.commit (); <br>
&nbsp; } <br>
} <o:p></o:p></span></b></p>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'><a href="#top" XXREF="#c21.7"></a><a
href="#top" XXREF="#c21.7"></a><a href="#top" XXREF="#c21.7"></a><a href="#top"
XXREF="#c21.7"></a><a href="#top" XXREF="#c21.7"></a><a href="#top"
XXREF="#c21.7"></a><a href="#top" XXREF="#c21.7"></a><a href="#top"
XXREF="#c21.7"></a><a href="#top" XXREF="#c21.7"></a><a href="#top"
XXREF="#c21.7"></a><a href="#top" XXREF="#c21.7"></a><a href="#top"
XXREF="#c21.7"></a><a href="#top" XXREF="#c21.7"></a><a href="#top"
XXREF="#c21.7"></a><a href="#top" XXREF="#c21.7"></a><a href="#top"
XXREF="#c21.7"></a><a href="#top" XXREF="#c21.7"></a><a href="#top"
XXREF="#c21.7"></a><a href="#top" XXREF="#c21.7"></a><a href="#top"
XXREF="#c21.7"><span lang=EN-GB style='mso-ansi-language:EN-GB'>10.7.</span></a></span><a
name=s21.7></a><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;
Compiling, Enhancing and Running your Program<o:p></o:p></span></h2>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>You are now ready to compile,
enhance and test your application program. First, compile all the .java source
files in the </span><span lang=EN-GB style='font-size:10.0pt;mso-ansi-language:
EN-GB'>&lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-GB'>/sharing/cpp/in/jfv/
</span></tt><span lang=EN-GB style='mso-ansi-language:EN-GB'>directory. Then
you should compile the </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>Example3 </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>program that is provided in </span><span
lang=EN-GB style='font-size:10.0pt;mso-ansi-language:EN-GB'>&lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span><tt><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>/sharing/cpp/in. </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>If you are using the </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>javac </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>compiler, you would need to do the
following: <o:p></o:p></span></h2>

<pre style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; cd </span></b><b style='mso-bidi-font-weight:
normal'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&lt;VERSANT_ROOT&gt;/demo/jvi/advanced<span
style='mso-bidi-font-weight:bold'>/sharing/cpp/in/jfv&nbsp;<o:p></o:p></span></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; javac *.java&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; cd ..&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; javac Example3.java<o:p></o:p></span></b></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Now, the compiled Java classes need
to be enhanced. To run the enhancer, you need a configuration file that
specifies the persistence categories for each of the application classes. <o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>Our configuration
file present in the </span></b><b style='mso-bidi-font-weight:normal'><span
lang=EN-GB style='font-size:10.0pt;mso-ansi-language:EN-GB'>&lt;VERSANT_ROOT&gt;/demo/jvi/advanced</span></b><tt><b><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>/sharing/cpp </span></b></tt><b><span lang=EN-GB style='font-size:18.0pt;
mso-ansi-language:EN-GB'>directory is called </span></b><tt><b><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>config.vj. </span></b></tt><b><span lang=EN-GB style='font-size:18.0pt;
mso-ansi-language:EN-GB'>This file looks as follows: <o:p></o:p></span></b></p>

<pre style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; c&nbsp; jfv.**&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; a&nbsp; Example*<o:p></o:p></span></b></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The first line specifies that all
classes under the jfv package are persistent capable. This jfv package includes
all the foreign language classes created from C++. Our example program classes
that are run are Persistent Aware. The Example programs access persistent
objects but are themselves not written to the database. <o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>You can run the
enhancer by specifying: <o:p></o:p></span></b></p>

<pre style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; java com.versant.Enhance -out ../out -verbose -config ../config.vj .<o:p></o:p></span></b></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>You are now set to run your
application program. To run </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>Example3 </span></tt><span
lang=EN-GB style='mso-ansi-language:EN-GB'>use: <o:p></o:p></span></h2>

<pre style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; cd </span></b><b style='mso-bidi-font-weight:
normal'><span lang=EN-GB style='mso-ansi-language:EN-GB'>&lt;VERSANT_ROOT&gt;/demo/jvi/advanced<span
style='mso-bidi-font-weight:bold'>/sharing/cpp/out&nbsp;<o:p></o:p></span></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; java Example3 cppdb<o:p></o:p></span></b></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>The output of your program should be
as follows: <o:p></o:p></span></h2>

<pre style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; FloorPlan: Acounting&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; Cube: 3&nbsp; Employee: Name: Beth Sterns&nbsp;&nbsp; Id: 206&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; Cube: 18&nbsp; Employee: Name: Seth Goldman&nbsp;&nbsp; Id: 688&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; Cube: 1&nbsp; Employee: Name: John Davis&nbsp;&nbsp; Id: 182&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp; Cube: 11&nbsp; Employee: Name: Steve Harmon&nbsp;&nbsp; Id: 336<o:p></o:p></span></b></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>You have successfully accessed
FloorPlan and Employee objects including the associations created from a C++
VEIDictionary, stored from the C++ language interface, in a Transparent JVI
program. <o:p></o:p></span></h2>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><b><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>Example3 </span></b></tt><b><span lang=EN-GB style='font-size:18.0pt;
mso-ansi-language:EN-GB'>also added a new association of a cube number to an Employee
to the VEIDictionary attribute of the C++ class. You can verify that the
FloorPlan instance contains the news association in the database by running the
C++ program </span></b><tt><b><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>example3_main </span></b></tt><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>with just a single
argument, the database name. Execute: the following messages to the <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><tt><b><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:
EN-GB'>example3_main cppdb</span></b></tt><b><span lang=EN-GB style='font-size:
18.0pt;mso-ansi-language:EN-GB'> <o:p></o:p></span></b></p>

<p style='margin-left:.5in;mso-outline-level:3;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><b><span
lang=EN-GB style='font-size:18.0pt;mso-ansi-language:EN-GB'>As mentioned
earlier, the C++ program will select all FloorPlan instances from the database
and print out their contents, including the cube number to employee
associations stored in the VEIDictionary attribute. <o:p></o:p></span></b></p>

<pre style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>Found: FloorPlan: Acounting&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>Cube No:&nbsp; 1 Employee: Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; John Davis&nbsp;&nbsp; Id:&nbsp;&nbsp; 182&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>Cube No:&nbsp; 3 Employee: Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Beth Sterns&nbsp;&nbsp; Id:&nbsp;&nbsp; 206&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>Cube No: 11 Employee: Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Steve Harmon&nbsp;&nbsp; Id:&nbsp;&nbsp; 336&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>Cube No: 18 Employee: Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Seth Goldman&nbsp;&nbsp; Id:&nbsp;&nbsp; 688&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>Cube No: 20 Employee: Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Gary Stevenson&nbsp;&nbsp; Id:&nbsp;&nbsp; 108<o:p></o:p></span></b></pre>

<h2 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=EN-GB style='mso-ansi-language:EN-GB'>Notice that the new association
created from JVI, </span><tt><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";mso-ansi-language:EN-GB'>Cube No: 20 Employee: Name:
Gary Stevenson Id: 108 </span></tt><span lang=EN-GB style='mso-ansi-language:
EN-GB'>is accessed from the C++ language interface. <o:p></o:p></span></h2>


<h2 align=center style='margin-left:.5in;text-align:center;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
lang=DE style='mso-ansi-language:DE'>

<hr size=2 width="100%" align=center>

</span></h2>


<h1 style='margin-left:.5in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><a
name=s22 XXREF="#c22"></a><a href="#top"><span style='mso-bookmark:s22'></span></a><span
style='mso-bookmark:s22'></span><a href="#top" XXREF="#c22"><span
style='mso-bookmark:s22'></span></a><span style='mso-bookmark:s22'></span><a
href="#top" XXREF="#c22"><span style='mso-bookmark:s22'></span></a><span
style='mso-bookmark:s22'></span><a href="#top" XXREF="#c22"><span
style='mso-bookmark:s22'></span></a><span style='mso-bookmark:s22'></span><a
href="#top" XXREF="#c22"><span style='mso-bookmark:s22'></span></a><span
style='mso-bookmark:s22'></span><a href="#top" XXREF="#c22"><span
style='mso-bookmark:s22'></span></a><span style='mso-bookmark:s22'></span><a
href="#top" XXREF="#c22"><span style='mso-bookmark:s22'></span></a><span
style='mso-bookmark:s22'></span><a href="#top" XXREF="#c22"><span
style='mso-bookmark:s22'></span></a><span style='mso-bookmark:s22'></span><a
href="#top" XXREF="#c22"><span style='mso-bookmark:s22'></span></a><span
style='mso-bookmark:s22'></span><a href="#top" XXREF="#c22"><span
style='mso-bookmark:s22'></span></a><span style='mso-bookmark:s22'></span><a
href="#top" XXREF="#c22"><span style='mso-bookmark:s22'></span></a><span
style='mso-bookmark:s22'></span><a href="#top" XXREF="#c22"><span
style='mso-bookmark:s22'></span></a><span style='mso-bookmark:s22'></span><a
href="#top" XXREF="#c22"><span style='mso-bookmark:s22'></span></a><span
style='mso-bookmark:s22'></span><a href="#top" XXREF="#c22"><span
style='mso-bookmark:s22'></span></a><span style='mso-bookmark:s22'></span><a
href="#top" XXREF="#c22"><span style='mso-bookmark:s22'></span></a><span
style='mso-bookmark:s22'></span><a href="#top" XXREF="#c22"><span
style='mso-bookmark:s22'></span></a><span style='mso-bookmark:s22'></span><a
href="#top" XXREF="#c22"><span style='mso-bookmark:s22'></span></a><span
style='mso-bookmark:s22'></span><a href="#top" XXREF="#c22"><span
style='mso-bookmark:s22'></span></a><span style='mso-bookmark:s22'></span><a
href="#top" XXREF="#c22"><span style='mso-bookmark:s22'></span></a><span
style='mso-bookmark:s22'></span><a href="#top" XXREF="#c22"><span
style='mso-bookmark:s22'><span lang=EN-GB style='mso-ansi-language:EN-GB'>Chapter
11.</span></span><span style='mso-bookmark:s22'></span></a><span
style='mso-bookmark:s22'></span><span lang=EN-GB style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;
com.versant.Db2Java Usage Notes<o:p></o:p></span></h1>

<pre style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>Usage:&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>java com.versant.Db2Java [-verbose] -d dbname [-o output-path]&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-class classname1 classname2 ....]&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-force] [-nosuper] [-usage|help]&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>This is a Java Foreign View command that generates Java source code for&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>database schema defined from C++ according to the options specified&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>Options:&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;-verbose:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; prints out verbose information during generation&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;-d dbname:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the database from which the schema is to be read&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from for object sharing with Java&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;-o output-path:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; specifies the path in which to generate the Java&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; source for the Java Foreign View classes. If not&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; specified, the current directory is assumed as&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;-class classname1 ...:&nbsp; specifies the classes which need to be shared&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; through the Java Foreign View. A list of class&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; names can be specified, each separated by a white&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; space character. Note that if this option is&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; specified, Java Foreign View source is generated&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; only for the list of classes specified and no&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; others.&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;-force:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; forces generation of Java Foreign View files in&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the output path. If this option is not specified,&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Java Foreign View files for classes are not&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; generated if any previous versions exist&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;-nosuper:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; prevents automatic generation of Java Foreign&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; View files for the super classes of any of the&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; classes specified in the class list against the&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -class option. If this option is not specified,&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Java Foreign View files for super classes get&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; automatically generated&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;-usage or -help:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; prints out complete usage information for this&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command. This terminates the command from running&nbsp;<o:p></o:p></span></b></pre><pre
style='margin-left:.5in;mso-outline-level:3'><b><span lang=EN-GB
style='mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></b><b><span
lang=DE style='mso-ansi-language:DE'>further<o:p></o:p></span></b></pre></div>

</body>

</html>
